Repository navigation
Replies: 2 comments
|
There is no command-line switch that injects set fallback into a justfile. --set only overrides variables that the justfile declares; fallback is a parser setting and must be present in that file. Also, fallback is checked on the justfile where lookup starts, so a parent cannot opt an unchanged child project into fallback. For foreign repositories, keep your personal recipes in a global/user justfile and invoke them explicitly: The no-cd attribute (or set no-cd on a current just version) keeps the recipe working in the directory where you invoked it. If you prefer a shorter command, add a forwarding alias: Then run jg my-recipe from projects/a or projects/b. This does not provide automatic “local first, then global” lookup under the same bare just command, but it avoids modifying unstable third-party justfiles and is unambiguous. The fallback behavior explicitly requires set fallback in the current justfile: Fallback to parent justfiles. Global/user justfile workflows are documented immediately afterward: Global and User justfiles. |
Uh oh!
There was an error while loading. Please reload this page.
I would like to add my own recipes to projects within a directory. Normally, a parent Justfile and
set fallbackwould do the job but these Justfiles do not have this setting (they come with external projects).For example, when in
projects/a/, I would like to call a recipe. If the recipe is not found inprojects/a/Justfile, it would be searched inprojects/Justfile. Exactly like fallback.Does somebody have an idea? Perhaps my problem boils down to: is there a way how to force a setting onto a foreign Justfile?
just --set fallbackdoes not work due to:Variable 'fallback' overridden on the command line but not present in justfile. I know aboutjust ../recipe; it works but is not ideal, I have to know in which Justfile the recipe is.Also, projects
a/andb/are pretty unstable – they are git repositories, new projects come and go, there are frequent worktrees, pulls etc., so modifying the project Justfiles would be pretty inconvenient.All reactions