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:
authorthriqon <github@jonasw.de>2015-02-25 22:42:09 +0300
committerForrest L Norvell <forrest@npmjs.com>2015-02-27 09:59:28 +0300
commit44da66456b530c049ff50953f78368460df87461 (patch)
treef4c809a0aa0d4bb31d89785ec4fc643c0dc49b31
parent687117a5bcd6a838cd1532ea7020ec6fcf0c33c0 (diff)
git: log full git command line on error
-rw-r--r--lib/utils/git.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/utils/git.js b/lib/utils/git.js
index 78cb083ee..a312770a8 100644
--- a/lib/utils/git.js
+++ b/lib/utils/git.js
@@ -18,8 +18,13 @@ function prefixGitArgs () {
}
function execGit (args, options, cb) {
- log.info("git", args)
- return exec(git, prefixGitArgs().concat(args || []), options, cb)
+ log.info('git', args)
+ var fullArgs = prefixGitArgs().concat(args || [])
+ return exec(git, fullArgs, options, function (err) {
+ if (err) log.error('git', fullArgs.join(' '))
+
+ cb.apply(null, arguments)
+ })
}
function spawnGit (args, options) {