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:
Diffstat (limited to 'lib/utils/git.js')
-rw-r--r--lib/utils/git.js23
1 files changed, 11 insertions, 12 deletions
diff --git a/lib/utils/git.js b/lib/utils/git.js
index 9c80ea553..2d9da1086 100644
--- a/lib/utils/git.js
+++ b/lib/utils/git.js
@@ -1,20 +1,19 @@
-
// handle some git configuration for windows
exports.spawn = spawnGit
exports.chainableExec = chainableExec
exports.whichAndExec = whichAndExec
-var exec = require("child_process").execFile
- , spawn = require("./spawn")
- , npm = require("../npm.js")
- , which = require("which")
- , git = npm.config.get("git")
- , assert = require("assert")
- , log = require("npmlog")
+var exec = require('child_process').execFile
+var spawn = require('./spawn')
+var npm = require('../npm.js')
+var which = require('which')
+var git = npm.config.get('git')
+var assert = require('assert')
+var log = require('npmlog')
function prefixGitArgs () {
- return process.platform === "win32" ? ["-c", "core.longpaths=true"] : []
+ return process.platform === 'win32' ? ['-c', 'core.longpaths=true'] : []
}
function execGit (args, options, cb) {
@@ -24,7 +23,7 @@ function execGit (args, options, cb) {
}
function spawnGit (args, options) {
- log.info("git", args)
+ log.info('git', args)
return spawn(git, prefixGitArgs().concat(args || []), options)
}
@@ -38,11 +37,11 @@ function whichGit (cb) {
}
function whichAndExec (args, options, cb) {
- assert.equal(typeof cb, "function", "no callback provided")
+ assert.equal(typeof cb, 'function', 'no callback provided')
// check for git
whichGit(function (err) {
if (err) {
- err.code = "ENOGIT"
+ err.code = 'ENOGIT'
return cb(err)
}