Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/lib/npm.js')
-rw-r--r--deps/npm/lib/npm.js19
1 files changed, 10 insertions, 9 deletions
diff --git a/deps/npm/lib/npm.js b/deps/npm/lib/npm.js
index 9d6cda386a7..4f810152513 100644
--- a/deps/npm/lib/npm.js
+++ b/deps/npm/lib/npm.js
@@ -22,6 +22,7 @@
var npmconf = require('./config/core.js')
var log = require('npmlog')
+ var tty = require('tty')
var path = require('path')
var abbrev = require('abbrev')
var which = require('which')
@@ -30,6 +31,7 @@
var aliases = require('./config/cmd-list').aliases
var cmdList = require('./config/cmd-list').cmdList
var plumbing = require('./config/cmd-list').plumbing
+ var output = require('./utils/output.js')
npm.config = {
loaded: false,
@@ -140,7 +142,7 @@
function defaultCb (er, data) {
log.disableProgress()
if (er) console.error(er.stack || er.message)
- else console.log(data)
+ else output(data)
}
npm.deref = function (c) {
@@ -261,7 +263,6 @@
npm.color = false
break
default:
- var tty = require('tty')
if (process.stdout.isTTY) npm.color = true
else if (!tty.isatty) npm.color = true
else if (tty.isatty(1)) npm.color = true
@@ -269,19 +270,19 @@
break
}
- log.resume()
+ if (config.get('unicode')) {
+ log.enableUnicode()
+ } else {
+ log.disableUnicode()
+ }
- if (config.get('progress')) {
+ if (config.get('progress') && (process.stderr.isTTY || (tty.isatty && tty.isatty(2)))) {
log.enableProgress()
} else {
log.disableProgress()
}
- if (config.get('unicode')) {
- log.enableUnicode()
- } else {
- log.disableUnicode()
- }
+ log.resume()
// at this point the configs are all set.
// go ahead and spin up the registry client.