@@ -233,7 +233,7 @@ byteenv(env::Union{AbstractVector{Pair{T,V}}, Tuple{Vararg{Pair{T,V}}}}) where {
233233 String[cstr (k* " =" * string (v)) for (k,v) in env]
234234
235235"""
236- setenv(command::Cmd, env; dir="" )
236+ setenv(command::Cmd, env; dir)
237237
238238Set environment variables to use when running the given `command`. `env` is either a
239239dictionary mapping strings to strings, an array of strings of the form `"var=val"`, or
@@ -242,13 +242,15 @@ existing environment, create `env` through `copy(ENV)` and then setting `env["va
242242as desired, or use [`addenv`](@ref).
243243
244244The `dir` keyword argument can be used to specify a working directory for the command.
245+ `dir` defaults to the currently set `dir` for `command` (which is the current working
246+ directory if not specified already).
245247
246248See also [`Cmd`](@ref), [`addenv`](@ref), [`ENV`](@ref), [`pwd`](@ref).
247249"""
248- setenv (cmd:: Cmd , env; dir= " " ) = Cmd (cmd; env= byteenv (env), dir= dir)
249- setenv (cmd:: Cmd , env:: Pair{<:AbstractString} ...; dir= " " ) =
250+ setenv (cmd:: Cmd , env; dir= cmd . dir ) = Cmd (cmd; env= byteenv (env), dir= dir)
251+ setenv (cmd:: Cmd , env:: Pair{<:AbstractString} ...; dir= cmd . dir ) =
250252 setenv (cmd, env; dir= dir)
251- setenv (cmd:: Cmd ; dir= " " ) = Cmd (cmd; dir= dir)
253+ setenv (cmd:: Cmd ; dir= cmd . dir ) = Cmd (cmd; dir= dir)
252254
253255"""
254256 addenv(command::Cmd, env...; inherit::Bool = true)
0 commit comments