Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

Commit

Permalink
Support --color=always to force colored mode
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Jan 25, 2011
1 parent 277dc30 commit a50e3ed
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions lib/utils/output.js
Expand Up @@ -12,8 +12,10 @@ var npm = require("../../npm")
, sys = require("./sys")

function doColor (stream) {
if (!npm.config.get("color")) return false
return isatty(stream)
var conf = npm.config.get("color")
return (!conf) ? false
: (conf === "always") ? true
: isatty(stream)
}
function isatty (stream) {
if (!stdio.isatty) return true
Expand Down
2 changes: 1 addition & 1 deletion lib/utils/parse-args.js
Expand Up @@ -21,7 +21,7 @@ exports.types =
, "auto-deactivate" : Boolean
, binroot : path
, browser : String
, color : Boolean
, color : ["always", Boolean]
, description : Boolean
, dev : Boolean
, editor : path
Expand Down

0 comments on commit a50e3ed

Please sign in to comment.