diff options
author | Forrest L Norvell <forrest@npmjs.com> | 2014-09-26 09:02:14 +0400 |
---|---|---|
committer | Forrest L Norvell <forrest@npmjs.com> | 2014-09-26 12:59:57 +0400 |
commit | 11a78536445fdcafccdb128d725f49727142f637 (patch) | |
tree | c229a0e3b032d50b69888279a19cc13be620168e /lib | |
parent | f24b552b596d0627549cdd7c2d68fcf9006ea50a (diff) |
code style tweaks
Diffstat (limited to 'lib')
-rw-r--r-- | lib/cache/add-local-tarball.js | 9 | ||||
-rw-r--r-- | lib/cache/add-remote-git.js | 2 | ||||
-rw-r--r-- | lib/cache/add-remote-tarball.js | 11 | ||||
-rw-r--r-- | lib/install.js | 8 | ||||
-rw-r--r-- | lib/utils/locker.js | 2 |
5 files changed, 16 insertions, 16 deletions
diff --git a/lib/cache/add-local-tarball.js b/lib/cache/add-local-tarball.js index d10bd3dd7..8bf676cc9 100644 --- a/lib/cache/add-local-tarball.js +++ b/lib/cache/add-local-tarball.js @@ -3,7 +3,6 @@ var mkdir = require("mkdirp") , fs = require("graceful-fs") , writeFileAtomic = require("write-file-atomic") , readJson = require("read-package-json") - , log = require("npmlog") , path = require("path") , sha = require("sha") , npm = require("../npm.js") @@ -13,7 +12,7 @@ var mkdir = require("mkdirp") , chownr = require("chownr") , inflight = require("inflight") , once = require("once") - , writeStream = require('fs-write-stream-atomic') + , writeStream = require("fs-write-stream-atomic") module.exports = addLocalTarball @@ -61,7 +60,7 @@ function addLocalTarball (p, pkgData, shasum, cb_) { , errState = null function errHandler (er) { if (errState) return - return cb(errState = er) + cb(errState = er) } from.on("error", errHandler) to.on("error", errHandler) @@ -117,7 +116,7 @@ function addTmpTarball (tgz, pkgData, shasum, cb) { // we already have the package info, so just move into place if (pkgData && pkgData.name && pkgData.version) { - return addTmpTarball_(tgz, pkgData, shasum, cb) + addTmpTarball_(tgz, pkgData, shasum, cb) } // This is a tarball we probably downloaded from the internet. @@ -179,7 +178,7 @@ function addTmpTarball_ (tgz, data, shasum, cb) { // chown starting from the first dir created by mkdirp, // or the root dir, if none had to be created, so that // we know that we get all the children. - function chown (er) { + function chown () { chownr(created || root, cs.uid, cs.gid, done) } diff --git a/lib/cache/add-remote-git.js b/lib/cache/add-remote-git.js index 95f21d42b..23ef9f89f 100644 --- a/lib/cache/add-remote-git.js +++ b/lib/cache/add-remote-git.js @@ -14,7 +14,7 @@ var mkdir = require("mkdirp") , inflight = require("inflight") , getCacheStat = require("./get-stat.js") , addLocalTarball = require("./add-local-tarball.js") - , writeStream = require('fs-write-stream-atomic') + , writeStream = require("fs-write-stream-atomic") // 1. cacheDir = path.join(cache,'_git-remotes',sha1(u)) diff --git a/lib/cache/add-remote-tarball.js b/lib/cache/add-remote-tarball.js index 69fde3660..b7dcda5f7 100644 --- a/lib/cache/add-remote-tarball.js +++ b/lib/cache/add-remote-tarball.js @@ -49,11 +49,12 @@ function addRemoteTarball (u, pkgData, shasum, cb_) { function addRemoteTarball_(u, tmp, shasum, cb) { // Tuned to spread 3 attempts over about a minute. // See formula at <https://github.com/tim-kos/node-retry>. - var operation = retry.operation - ( { retries: npm.config.get("fetch-retries") - , factor: npm.config.get("fetch-retry-factor") - , minTimeout: npm.config.get("fetch-retry-mintimeout") - , maxTimeout: npm.config.get("fetch-retry-maxtimeout") }) + var operation = retry.operation({ + retries: npm.config.get("fetch-retries") + , factor: npm.config.get("fetch-retry-factor") + , minTimeout: npm.config.get("fetch-retry-mintimeout") + , maxTimeout: npm.config.get("fetch-retry-maxtimeout") + }) operation.attempt(function (currentAttempt) { log.info("retry", "fetch attempt " + currentAttempt diff --git a/lib/install.js b/lib/install.js index 669ee5017..fe36ee017 100644 --- a/lib/install.js +++ b/lib/install.js @@ -208,7 +208,7 @@ function findPeerInvalid (where, cb) { function findPeerInvalid_ (packageMap, fpiList) { if (fpiList.indexOf(packageMap) !== -1) - return + return undefined fpiList.push(packageMap) @@ -951,15 +951,15 @@ function write (target, targetFolder, context, cb_) { // is the list of installed packages from that last thing. if (!er) return cb_(er, data) - if (false === npm.config.get("rollback")) return cb_(er) + if (npm.config.get("rollback") === false) return cb_(er) npm.rollbacks.push(targetFolder) cb_(er, data) } var bundled = [] - chain - ( [ [ cache.unpack, target.name, target.version, targetFolder + chain( + [ [ cache.unpack, target.name, target.version, targetFolder , null, null, user, group ] , [ fs, "writeFile" , path.resolve(targetFolder, "package.json") diff --git a/lib/utils/locker.js b/lib/utils/locker.js index 9e322d7af..343ebce35 100644 --- a/lib/utils/locker.js +++ b/lib/utils/locker.js @@ -18,7 +18,7 @@ function lockFileName (u) { var myLocks = {} function lock (u, cb) { // the cache dir needs to exist already for this. - getCacheStat(function (er, cs) { + getCacheStat(function (er) { if (er) return cb(er) var opts = { stale: npm.config.get("cache-lock-stale") , retries: npm.config.get("cache-lock-retries") |