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
addenv(), by default, should inherit from ENV (#39100)
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()`.
(cherry picked from commit fa14d0b)
0 commit comments