casey / just

🤖 Just a command runner
https://just.systems
Creative Commons Zero v1.0 Universal
17.59k stars 399 forks source link

make just-functions accept just-variables #2008

Open woutervh opened 3 weeks ago

woutervh commented 3 weeks ago

just has a set of functions you can use in recipes:

see https://just.systems/man/en/chapter_31.html

but what if path itself is a variable?

For example

BIN_DIR := env_var_or_default("BIN_DIR", "${HOME/bin")
BIN_ABS_DIR := absolute_path({{BIN_DIR }})  # breaks syntax

It seems you can currently not pass such variable to a function.

laniakea64 commented 3 weeks ago

Does this do what you're looking for? -

BIN_DIR := env_var_or_default("BIN_DIR", env_var("HOME") / "bin")
BIN_ABS_DIR := absolute_path(BIN_DIR)