Add workingDir parameter to execProcess and test (#9549)
* Add workingDir parameter to execProcess * Fix tests/stdlib/tosproc.nim compile error * Suppress output from tosproc.nim
This commit is contained in:
parent
3f3aee4078
commit
3a3ff76526
3 changed files with 35 additions and 1 deletions
|
|
@ -64,6 +64,7 @@ const poUseShell* {.deprecated.} = poUsePath
|
|||
## Deprecated alias for poUsePath.
|
||||
|
||||
proc execProcess*(command: string,
|
||||
workingDir: string = "",
|
||||
args: openArray[string] = [],
|
||||
env: StringTableRef = nil,
|
||||
options: set[ProcessOption] = {poStdErrToStdOut,
|
||||
|
|
@ -349,12 +350,13 @@ proc select*(readfds: var seq[Process], timeout = 500): int
|
|||
|
||||
when not defined(useNimRtl):
|
||||
proc execProcess(command: string,
|
||||
workingDir: string = "",
|
||||
args: openArray[string] = [],
|
||||
env: StringTableRef = nil,
|
||||
options: set[ProcessOption] = {poStdErrToStdOut,
|
||||
poUsePath,
|
||||
poEvalCommand}): TaintedString =
|
||||
var p = startProcess(command, args=args, env=env, options=options)
|
||||
var p = startProcess(command, workingDir=workingDir, args=args, env=env, options=options)
|
||||
var outp = outputStream(p)
|
||||
result = TaintedString""
|
||||
var line = newStringOfCap(120).TaintedString
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue