Open arctic-hen7 opened 3 years ago
I found the availability of the env_files = [ ".env" ]
key. ^^
This is what I need, I hadn't seen that before.
But anyway, dynamic variables from commands sound very exciting and useful!
This is great, it's exactly what I want for my current problem.
I have the following bonnie file:
version = "0.3.2"
[scripts]
build = "docker build -t \"${TARGET_IMAGE}:latest\" ."
tag = "docker tag ${TARGET_IMAGE}:latest ${TARGET_IMAGE}:${MC_BASE_IMAGE_VERSION}"
The problem is, that I need to define these ENV Vars outside of the bonnie.toml and find a way to load them on every bonnie command.
This hashmap feature would solve that problem, since it would pass all HashMap variables into the environment of the bonnie commands!
Description A new top-level
HashMap
[variables]
, which would allow the derivation of values that can be interpolated into commands. When preparing a command to be run, we'd compute their values (they'd be fully-fledged command cores themselves, their outputs become the values) and interpolate them. We could then store the values we've attained in a temporaryHashMap
that we pass around to each subcommand etc. so we don't compute any unnecessary values, but we also don't compute any values twice.Reasoning Make does this excellently, and Bonnie has reached the point where this feature is really a must. I see this as the third type of interpolation in addition to arguments and environment variables.
Are you willing to work on an implementation of this? Yes.