* show cmd used with --verbose (even on success) * honor -p:-u:release * address comment * remove --showCmds flag * remove quoteShell * fix #783 * Revert "fix #783" This reverts commit af0ac004c00f17e9983c63ab99e40cd38ba6aaa4. * fix #783 by fixing the gist instead * Revert "fix #783 by fixing the gist instead" now that upstream gist was updated with my patch This reverts commit 8bec86039d8335af152acf238ab14d0268e003e5.
This commit is contained in:
parent
68a9c4c955
commit
a10691bdf2
3 changed files with 13 additions and 6 deletions
|
|
@ -251,10 +251,14 @@ proc buildFromDir(
|
||||||
if not existsDir(outputDir):
|
if not existsDir(outputDir):
|
||||||
createDir(outputDir)
|
createDir(outputDir)
|
||||||
|
|
||||||
|
let input = realDir / bin.changeFileExt("nim")
|
||||||
|
# `quoteShell` would be more robust than `\"` (and avoid quoting when
|
||||||
|
# un-necessary) but would require changing `extractBin`
|
||||||
|
let cmd = "\"$#\" $# --noNimblePath $# $# $# \"$#\"" %
|
||||||
|
[getNimBin(), pkgInfo.backend, nimblePkgVersion,
|
||||||
|
join(args, " "), outputOpt, input]
|
||||||
try:
|
try:
|
||||||
doCmd("\"" & getNimBin() & "\" $# --noNimblePath $# $# $# \"$#\"" %
|
doCmd(cmd, showCmd = true)
|
||||||
[pkgInfo.backend, nimblePkgVersion, join(args, " "), outputOpt,
|
|
||||||
realDir / bin.changeFileExt("nim")])
|
|
||||||
binariesBuilt.inc()
|
binariesBuilt.inc()
|
||||||
except NimbleError:
|
except NimbleError:
|
||||||
let currentExc = (ref NimbleError)(getCurrentException())
|
let currentExc = (ref NimbleError)(getCurrentException())
|
||||||
|
|
@ -382,7 +386,7 @@ proc installFromDir(dir: string, requestedVer: VersionRange, options: Options,
|
||||||
options.action.passNimFlags
|
options.action.passNimFlags
|
||||||
else:
|
else:
|
||||||
@[]
|
@[]
|
||||||
buildFromDir(pkgInfo, paths, flags & "-d:release", options)
|
buildFromDir(pkgInfo, paths, "-d:release" & flags, options)
|
||||||
|
|
||||||
let pkgDestDir = pkgInfo.getPkgDest(options)
|
let pkgDestDir = pkgInfo.getPkgDest(options)
|
||||||
if existsDir(pkgDestDir) and existsFile(pkgDestDir / "nimblemeta.json"):
|
if existsDir(pkgDestDir) and existsFile(pkgDestDir / "nimblemeta.json"):
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ proc extractBin(cmd: string): string =
|
||||||
else:
|
else:
|
||||||
return cmd.split(' ')[0]
|
return cmd.split(' ')[0]
|
||||||
|
|
||||||
proc doCmd*(cmd: string, showOutput = false) =
|
proc doCmd*(cmd: string, showOutput = false, showCmd = false) =
|
||||||
let bin = extractBin(cmd)
|
let bin = extractBin(cmd)
|
||||||
if findExe(bin) == "":
|
if findExe(bin) == "":
|
||||||
raise newException(NimbleError, "'" & bin & "' not in PATH.")
|
raise newException(NimbleError, "'" & bin & "' not in PATH.")
|
||||||
|
|
@ -20,6 +20,9 @@ proc doCmd*(cmd: string, showOutput = false) =
|
||||||
stdout.flushFile()
|
stdout.flushFile()
|
||||||
stderr.flushFile()
|
stderr.flushFile()
|
||||||
|
|
||||||
|
if showCmd:
|
||||||
|
display("Executing", cmd, priority = MediumPriority)
|
||||||
|
else:
|
||||||
displayDebug("Executing", cmd)
|
displayDebug("Executing", cmd)
|
||||||
if showOutput:
|
if showOutput:
|
||||||
let exitCode = execCmd(cmd)
|
let exitCode = execCmd(cmd)
|
||||||
|
|
|
||||||
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue