Merge pull request #470 from jxy/notty_nocolor

noColor if stdout is not a tty
This commit is contained in:
Dominik Picheta 2018-03-27 18:38:50 +01:00 committed by GitHub
commit 287fa0fe59
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,7 +1,7 @@
# Copyright (C) Dominik Picheta. All rights reserved. # Copyright (C) Dominik Picheta. All rights reserved.
# BSD License. Look at license.txt for more info. # BSD License. Look at license.txt for more info.
import json, strutils, os, parseopt, strtabs, uri, tables import json, strutils, os, parseopt, strtabs, uri, tables, terminal
from httpclient import Proxy, newProxy from httpclient import Proxy, newProxy
import config, version, tools, common, cli import config, version, tools, common, cli
@ -328,6 +328,7 @@ proc initOptions*(): Options =
result.pkgInfoCache = newTable[string, PackageInfo]() result.pkgInfoCache = newTable[string, PackageInfo]()
result.nimbleDir = "" result.nimbleDir = ""
result.verbosity = HighPriority result.verbosity = HighPriority
result.noColor = not isatty(stdout)
proc parseMisc(options: var Options) = proc parseMisc(options: var Options) =
# Load nimbledata.json # Load nimbledata.json