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

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2014-06-10 01:53:53 +0400
committerisaacs <i@izs.me>2014-06-10 02:52:36 +0400
commita817d5d688a187bf1c83a58afb0be0b1b84e4883 (patch)
tree68902a445cdb98562a87b048792daa0300f274d2 /lib/npm.js
parentbb42b9b5ca185b573c75cd8135eddc66150a5c09 (diff)
Only spin the spinner when we're fetching stuff
Diffstat (limited to 'lib/npm.js')
-rw-r--r--lib/npm.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/npm.js b/lib/npm.js
index c0c744f99..f2319bfd5 100644
--- a/lib/npm.js
+++ b/lib/npm.js
@@ -163,13 +163,16 @@ var commandCache = {}
npm.spinner =
{ int: null
+ , started: false
, start: function () {
if (npm.spinner.int) return
var c = npm.config.get("spin")
if (!c) return
var stream = npm.config.get("logstream")
var opt = { tty: c !== "always", stream: stream }
+ opt.cleanup = !npm.spinner.started
npm.spinner.int = charSpin(opt)
+ npm.spinner.started = true
}
, stop: function () {
clearInterval(npm.spinner.int)
@@ -199,8 +202,6 @@ Object.keys(abbrevs).concat(plumbing).forEach(function addCommand (c) {
}
if (args.length === 1) args.unshift([])
- npm.spinner.start()
-
npm.registry.version = npm.version
if (!npm.registry.refer) {
npm.registry.refer = [a].concat(args[0]).map(function (arg) {