@@ -230,7 +230,7 @@ byteenv(env::Union{AbstractVector{Pair{T,V}}, Tuple{Vararg{Pair{T,V}}}}) where {
230230 String[cstr (k* " =" * string (v)) for (k,v) in env]
231231
232232"""
233- setenv(command::Cmd, env; dir="" )
233+ setenv(command::Cmd, env; dir)
234234
235235Set environment variables to use when running the given `command`. `env` is either a
236236dictionary mapping strings to strings, an array of strings of the form `"var=val"`, or
@@ -239,11 +239,13 @@ existing environment, create `env` through `copy(ENV)` and then setting `env["va
239239as desired, or use `addenv`.
240240
241241The `dir` keyword argument can be used to specify a working directory for the command.
242+ `dir` defaults to the currently set `dir` for `command` (which is the current working
243+ directory if not specified already).
242244"""
243- setenv (cmd:: Cmd , env; dir= " " ) = Cmd (cmd; env= byteenv (env), dir= dir)
244- setenv (cmd:: Cmd , env:: Pair{<:AbstractString} ...; dir= " " ) =
245+ setenv (cmd:: Cmd , env; dir= cmd . dir ) = Cmd (cmd; env= byteenv (env), dir= dir)
246+ setenv (cmd:: Cmd , env:: Pair{<:AbstractString} ...; dir= cmd . dir ) =
245247 setenv (cmd, env; dir= dir)
246- setenv (cmd:: Cmd ; dir= " " ) = Cmd (cmd; dir= dir)
248+ setenv (cmd:: Cmd ; dir= cmd . dir ) = Cmd (cmd; dir= dir)
247249
248250"""
249251 addenv(command::Cmd, env...; inherit::Bool = true)
0 commit comments