Fixes return values of execCmd on macos (#19963)

* Fixes return values of execCmd on macos

* update tests to use existing structure

Co-authored-by: daniel <danielclarke@wearepopgun.com>
This commit is contained in:
Daniel Clarke 2022-07-06 06:29:05 +10:00 • committed by GitHub
commit 01b40dc1d7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 1 deletions

View file

@ -1523,7 +1523,7 @@ elif not defined(useNimRtl):
header: "<stdlib.h>".}
proc execCmd(command: string): int =
when defined(linux):
when defined(posix):
let tmp = csystem(command)
result = if tmp == -1: tmp else: exitStatusLikeShell(tmp)
else: