casey / just

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

allow `import <variable-name> ` #1975

Open Ziqi-Yang opened 1 month ago

Ziqi-Yang commented 1 month ago

For example:

import? join(config_directory(), "mpm/root.just")
Ziqi-Yang commented 1 month ago

The same need for all set variables, like:

set dotenv-path := "" + MPM_CONFIG_DIR + "/config"

I want to create an application mainly using just. Currently I can only do things like import? '~/.mpm.root.just', which is awkward.

JonathanDoughty commented 2 weeks ago

The inability to do variable (or environment variable) substitution for import paths ended up preventing me from a desired DRYing out of Justfile content as well, rather than having to duplicate a Justfile name that I want to include as part of replicating a subset of local contents.

It appears that just's GRAMMAR (currently) accepts only strings for imports as well as modules; so not sure if there is any easy way to implement this without big impacts.