Skip to content

Commit

Permalink
(fix) pass --colors:off to Nim compiler properly (#1164)
Browse files Browse the repository at this point in the history
  • Loading branch information
xTrayambak authored Mar 28, 2024
1 parent 2d93b46 commit b118e25
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/nimble.nim
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,9 @@ proc buildFromDir(pkgInfo: PackageInfo, paths: HashSet[string],
if options.verbosity == SilentPriority:
# Hide Nim warnings
args.add("--warnings:off")
if options.noColor:
# Disable coloured output
args.add("--colors:off")

let binToBuild =
# Only build binaries specified by user if any, but only if top-level package,
Expand Down Expand Up @@ -225,8 +228,8 @@ proc buildFromDir(pkgInfo: PackageInfo, paths: HashSet[string],
let input = realDir / src.changeFileExt("nim")
# `quoteShell` would be more robust than `\"` (and avoid quoting when
# un-necessary) but would require changing `extractBin`
let cmd = "$# $# --colors:on --noNimblePath $# $# $#" % [
pkgInfo.getNimBin(options).quoteShell, pkgInfo.backend, join(args, " "),
let cmd = "$# $# --colors:$# --noNimblePath $# $# $#" % [
pkgInfo.getNimBin(options).quoteShell, pkgInfo.backend, if options.noColor: "off" else: "on", join(args, " "),
outputOpt, input.quoteShell]
try:
doCmd(cmd)
Expand Down

0 comments on commit b118e25

Please sign in to comment.