-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The spirit of `addenv()` is to be non-destructive, however because a `Cmd` object with an `env` member that is set to `nothing` (the default) inherts from the current environment when it is run. This means that the following, rather surprising behavior holds true on current master: ``` julia> ENV["FOO"] = "foo" run(`/bin/bash -c "echo \$FOO \$BAR"`) run(addenv(`/bin/bash -c "echo \$FOO \$BAR"`, "BAR" => "bar")) foo bar ``` This PR adds an `inherit` flag to `addenv()` to allow keeping this behavior if it is actually desired (this might make sense if you are constructing `.env` blocks over a series of `addenv()` calls and you don't want to have to special-case your first operation as a `setenv()` rather than an `addenv()`.
- Loading branch information
1 parent
c70a5bc
commit fa14d0b
Showing
2 changed files
with
35 additions
and
8 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