Repository navigation
Pattern to auto-load remote justfiles #3194
spwoodcock
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I love the remote justfiles idea.
Not for everything, of course - many recipes belong in a specific repo - but I use them to add recipes to install
nerdctl, build helm charts, etc (things that don't change and aren't repo specific).Anyway, the problem with the suggested approach:
is that the user then has to:
To make this a bit more seamless, I wanted the justfile to auto-download when the remote commands are invoked.
In addition, I didn't want to have to maintain a module in the downstream repo that is a placeholder for the remote module.
How I'm using remote justfiles
The remote justfile, stored in a git repo:
foo.justThe local repo justfile:
JustfileNow I can:
justand view all top level modules.just foo mycommandimmediately, and the remote file downloads and executes.just footo view the available subcommands.Note that the ordering really matters here:
defaultand optionalhelpcommand.Caveats:
mainbranch, so all repos can be updated by updating the remote justfile (as I mentioned, bad idea with things that have potential to break, but fine for very consistent things that don't change much, and aren't repo specific).foo.justbefore doing the curl command. This means curl runs every time to replace the file - a good tradeoff for me, as it makes sure the commands are up to date.All reactions