forked from nim-lang/Nim
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed an issue where
errorCode
was always 0 when startProcess
did… (
nim-lang#23992) …n't use the `poEvalCommand` flag https://forum.nim-lang.org/t/12310 Added a test case, tested on my fedora system.
- Loading branch information
Showing
2 changed files
with
25 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
discard """ | ||
output: '''true | ||
true''' | ||
""" | ||
|
||
import std/osproc | ||
|
||
const command = "lsaaa -lah" | ||
|
||
try: | ||
let process = startProcess(command, options = {poUsePath}) | ||
discard process.waitForExit() | ||
except OSError as e: | ||
echo e.errorCode != 0 | ||
|
||
let process = startProcess(command, options = {poUsePath, poEvalCommand}) | ||
let exitCode = process.waitForExit() | ||
echo exitCode != 0 |