mill icon indicating copy to clipboard operation
mill copied to clipboard

Add default value support in variable interpolator (YAML frontmatter and config files)

Open lefou opened this issue 8 months ago • 0 comments

Address review comment https://github.com/com-lihaoyi/mill/pull/4983#issuecomment-2828050803 by @lihaoyi

we should have some story around how to handle optional environment variables. I don't know the exact use cases that those would apply, but I imagine having something like mill-java-opts: ["--jobs=${NUM_THREADS or 0}"] would be a use case people may have.

And my reply https://github.com/com-lihaoyi/mill/pull/4983#issuecomment-2828091842

We should use whatever is common in POSIX shells for that task. I think in bash it is ${VAR:-default_value}.

lefou avatar Apr 24 '25 15:04 lefou