minor style changes

This commit is contained in:
Araq 2019-07-10 23:55:56 +02:00
commit 38bdf1cd7f
11 changed files with 60 additions and 56 deletions

View file

@ -28,7 +28,7 @@ proc findNim*(): string =
proc exec*(cmd: string, errorcode: int = QuitFailure, additionalPath = "") =
let prevPath = getEnv("PATH")
if additionalPath.len > 0:
var absolute = additionalPATH
var absolute = additionalPath
if not absolute.isAbsolute:
absolute = getCurrentDir() / absolute
echo("Adding to $PATH: ", absolute)
@ -57,10 +57,10 @@ proc execCleanPath*(cmd: string,
# simulate a poor man's virtual environment
let prevPath = getEnv("PATH")
when defined(windows):
let CleanPath = r"$1\system32;$1;$1\System32\Wbem" % getEnv"SYSTEMROOT"
let cleanPath = r"$1\system32;$1;$1\System32\Wbem" % getEnv"SYSTEMROOT"
else:
const CleanPath = r"/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin"
putEnv("PATH", CleanPath & PathSep & additionalPath)
const cleanPath = r"/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin"
putEnv("PATH", cleanPath & PathSep & additionalPath)
echo(cmd)
if execShellCmd(cmd) != 0: quit("FAILURE", errorcode)
putEnv("PATH", prevPath)
@ -280,14 +280,14 @@ lib/wrappers/odbcsql.nim
lib/js/jscore.nim
""".splitWhitespace()
proc sexec(cmds: openarray[string]) =
proc sexec(cmds: openArray[string]) =
## Serial queue wrapper around exec.
for cmd in cmds:
echo(cmd)
let (outp, exitCode) = osproc.execCmdEx(cmd)
if exitCode != 0: quit outp
proc mexec(cmds: openarray[string]) =
proc mexec(cmds: openArray[string]) =
## Multiprocessor version of exec
let r = execProcesses(cmds, {poStdErrToStdOut, poParentStreams, poEchoCmd})
if r != 0: