-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Iterate on
.env
files: make the behavior override (#10094)
Follow up to #10093. After discussing with @orta, the `--add-env-files` flag being additive instead of overriding wasn't a sticking point in the original implementation, and the more feedback I get, it seems like most people expect later files to override earlier ones, so let's switch the behavior. In tandem, at first I tried to rename the flag back to just `--env-file` or `--env-files`, but I'm afraid both give this cryptic error: ``` redwood-app % yarn rw --env-file prod node: prod: not found # Or `yarn rw --env-files prod`, which also gives this error, # which I didn't know node would also process? Their docs only say `--env-file`... ``` The above was with my framework changes. I tried it again without my framework changes and the error persists. As far as I can tell, `rw` never executes and it seems like the Node.js binary itself is evaluating the `--env-file` flag. It supports `--env-file` now, and expects it to be a full path (so `.env.prod`). But this isn't how I thought node processes `process.argv` at all... I thought that all flags would've been passed to the script (here, `rw`) for processing. But maybe not, and if so that means we can just pass options to node via `yarn rw --my-node-option`. Which I still don't quite believe and if it is true, then I'm not sure what to make of yet cause people have been wanting to pass node options for a while and I always thought `NODE_OPTIONS="--my-node-option" yarn rw ...` was the only way. So TL;DR, that's why I've left the name here and I'd like to keep that friction point out of the scope of this PR being considered mergeable.
- Loading branch information
Showing
5 changed files
with
41 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters