-
Notifications
You must be signed in to change notification settings - Fork 500
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Include files from variable location #1580
Comments
I would love to see this functionality implemented in a similar way to how Terraform references remote modules. Basically allow the user to enter a remote git repository URL and ref (branch, tag, commit) which would get fetched and used. This is a total game changer and would allow you to write independent justfiles in repos that reference centralized remote files as common "includes". The implications of this for use with CI systems are really quite amazing. |
How about using a git submodule (assuming you have your stuff in git of course)? |
I just merged #2055, which adds a new kind of shell-expanded string literal. They look like this |
@casey For me this syntax only works in settings, optional imports, With this example justfile -
I get -
Same error with either |
Whoops! I neglected to extend the parser to accept shell expanded string in |
I'm in a situation where I have multiple repos that pretty much all need the same justfiles and rather than duplicating the files and maintaining the duplicates I thought it would be great to have a central repository with the command definitions that get included in other projects.
Conceptually this already works great, the only problem is the location of the shared repository. I can either hardcode it to an absolute location on the filesystem (which doesn't work well with people working on the projects on different operating systems, and CI probably also doesn't like that very much) or use git submodules to include the shared repository in the project (which also comes with its own set of complications).
However, I think it would be really nice if just could resolve the to-be-included files from a variable location. There's different things that could work here, for example:
!include $JUST_INCLUDES/module/common.justfile
I get the aim of the initial implementation to provide a simple solution for includes. I'm hoping neither of the two options would add too much complexity to the implementation 🙂
The text was updated successfully, but these errors were encountered: