Skip to content

Commit

Permalink
resolves npm#5867: specify dummy template dir when cloning
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher Hiller committed Aug 3, 2014
1 parent 9b318e2 commit 846d3e9
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions lib/cache/add-remote-git.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,14 @@ module.exports = function addRemoteGit (u, silent, cb_) {

var p = path.join(npm.config.get("cache"), "_git-remotes", v)

checkGitDir(p, u, co, origUrl, silent, function(er, data) {
addModeRecursive(p, npm.modes.file, function(erAddMode) {
if (er) return cb(er, data)
return cb(erAddMode, data)
// we don't need global templates when cloning. use this empty dir to specify as template dir
mkdir(path.join(npm.config.get("cache"), "_git-remotes", "_templates"), function(er) {
if (er) return cb(er)
checkGitDir(p, u, co, origUrl, silent, function(er, data) {
addModeRecursive(p, npm.modes.file, function(erAddMode) {
if (er) return cb(er, data)
return cb(erAddMode, data)
})
})
})
})
Expand Down Expand Up @@ -110,7 +114,8 @@ function cloneGitRemote (p, u, co, origUrl, silent, cb) {
mkdir(p, function (er) {
if (er) return cb(er)

var args = [ "clone", "--mirror", u, p ]
var args = [ "clone", "--template=" + path.join(npm.config.get("cache"),
"_git_remotes", "_templates"), "--mirror", u, p ]
var env = gitEnv()

// check for git
Expand Down

0 comments on commit 846d3e9

Please sign in to comment.