* 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):
|
||||
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:
|
||||
doCmd("\"" & getNimBin() & "\" $# --noNimblePath $# $# $# \"$#\"" %
|
||||
[pkgInfo.backend, nimblePkgVersion, join(args, " "), outputOpt,
|
||||
realDir / bin.changeFileExt("nim")])
|
||||
doCmd(cmd, showCmd = true)
|
||||
binariesBuilt.inc()
|
||||
except NimbleError:
|
||||
let currentExc = (ref NimbleError)(getCurrentException())
|
||||
|
|
@ -382,7 +386,7 @@ proc installFromDir(dir: string, requestedVer: VersionRange, options: Options,
|
|||
options.action.passNimFlags
|
||||
else:
|
||||
@[]
|
||||
buildFromDir(pkgInfo, paths, flags & "-d:release", options)
|
||||
buildFromDir(pkgInfo, paths, "-d:release" & flags, options)
|
||||
|
||||
let pkgDestDir = pkgInfo.getPkgDest(options)
|
||||
if existsDir(pkgDestDir) and existsFile(pkgDestDir / "nimblemeta.json"):
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ proc extractBin(cmd: string): string =
|
|||
else:
|
||||
return cmd.split(' ')[0]
|
||||
|
||||
proc doCmd*(cmd: string, showOutput = false) =
|
||||
proc doCmd*(cmd: string, showOutput = false, showCmd = false) =
|
||||
let bin = extractBin(cmd)
|
||||
if findExe(bin) == "":
|
||||
raise newException(NimbleError, "'" & bin & "' not in PATH.")
|
||||
|
|
@ -20,7 +20,10 @@ proc doCmd*(cmd: string, showOutput = false) =
|
|||
stdout.flushFile()
|
||||
stderr.flushFile()
|
||||
|
||||
displayDebug("Executing", cmd)
|
||||
if showCmd:
|
||||
display("Executing", cmd, priority = MediumPriority)
|
||||
else:
|
||||
displayDebug("Executing", cmd)
|
||||
if showOutput:
|
||||
let exitCode = execCmd(cmd)
|
||||
displayDebug("Finished", "with exit code " & $exitCode)
|
||||
|
|
|
|||
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue