-
-
Save amb26/e4bc4a7e8054fea73d43 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- git.js 2015-05-11 16:19:29.114852900 -0400 | |
+++ git-patched.js 2015-05-11 16:19:35.788234600 -0400 | |
@@ -12,14 +12,23 @@ | |
, git = npm.config.get("git") | |
, assert = require("assert") | |
, log = require("npmlog") | |
+ , win32 = process.platform === "win32" | |
+ , cygwin = win32 && (process.env.ORIGINAL_PATH || '').indexOf('/cygdrive/') != -1 | |
function prefixGitArgs () { | |
- return process.platform === "win32" ? ["-c", "core.longpaths=true"] : [] | |
+ return win32 ? ["-c", "core.longpaths=true"] : [] | |
} | |
function execGit (args, options, cb) { | |
- log.info('git', args) | |
+ if(cygwin && args) { | |
+ for(var i=0; i<args.length; i++) { | |
+ if(':\\'.indexOf(args[i]) != 1) { | |
+ args[i] = args[i].replace(/\\/g, '/').replace(/^([A-Za-z])\:\//, '/cygdrive/$1/'); | |
+ } | |
+ } | |
+ } | |
var fullArgs = prefixGitArgs().concat(args || []) | |
+ log.info('git', fullArgs) | |
return exec(git, fullArgs, options, cb) | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment