Skip to content
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

Add dotenv-filename and dotenv-path to in-justfile settings #1692

Merged

Conversation

ltfourrier
Copy link
Contributor

Context

I was trying to load a .env file located in another directory from multiple other justfiles for a project with a lot of repositories earlier and couldn't find any way to do that in the documentation.

After checking the code, I found the --dotenv-filename and --dotenv-path arguments that did exactly what I needed to do (introduced in #941), but it was impossible to set those options in the justfile directly.

Changes

This pull request pretty much makes the --dotenv-filename and --dotenv-path available as settings that can be set using the set keyword in a justfile.

The implementation of the load_dotenv function was modified so that it considers these new settings, on top of the already existing program arguments. The program arguments take precedence over the settings in the justfile.

The documentation in README.md was updated to reflect those changes.

Caveats

I found out right before creating this PR that there was already a pull request (#1640) and a few open issues about this topic (#945), and did not take them into account during implementation. There's some very good ideas floating in these, but my PR just exposes the existing program arguments as settings.

I did not update the documentation in README.中文.md since I cannot read or write Chinese.

@casey casey enabled auto-merge (squash) October 12, 2023 05:02
@casey
Copy link
Owner

casey commented Oct 12, 2023

Looks great! I collapsed the various sections about the dotenv integration into one, since otherwise there would be a bunch of repetition and cross-linking.

@casey casey merged commit 812e1ea into casey:master Oct 12, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants