You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add --envrc-dir flag to allow specifying location of direnv config (#2629)
## Summary
Fixes#2459 - devbox generate direnv does not respect --config
It seems that the previous mode of operation for `devbox generate direnv
--config <some-dir>` used `--config` to determine the location of the
resulting `.envrc` file, rather than as the location of the
`devbox.json` file. But in some cases it is desired to be able to
specify not only the location of not only the direnv `.envrc` file, but
also the devbox config file. Or at least to be able to specify just the
location of the devbox config with the `.envrc` being in the current
directory.
To accomplish this, without breaking the current mode of operation, a
new parameter is added, `--envrc-dir`, which specifies the location of
the resulting `.envrc` file. For example, the command `devbox generate
direnv --envrc-dir ABC --config ABC/XYZ` would create `ABC/.envrc` and
within that would be the command `eval "$(devbox generate direnv
--print-envrc --config XYZ)"`
Without the new `--envrc-dir` param, operation is the same as it was
previously.
The output from `--print-envrc` now invokes `devbox shellenv...` prior
to the `watch_file` command. This allows us to use
`$DEVBOX_PROJECT_ROOT` to specify the path to the config and lock files.
This ensures the correct files are being watched.
## How was it tested?
Several new tests have been created to cover cases with and without the
new `--envrc-dir` param.
## Community Contribution License
All community contributions in this pull request are licensed to the
project
maintainers under the terms of the
[Apache 2 License](https://www.apache.org/licenses/LICENSE-2.0).
By creating this pull request, I represent that I have the right to
license the
contributions to the project maintainers under the Apache 2 License as
stated in
the
[Community Contribution
License](https://github.com/jetify-com/opensource/blob/main/CONTRIBUTING.md#community-contribution-license).
---------
Co-authored-by: Mike Landau <mikeland86@gmail.com>
0 commit comments