Comparing version 1.1.3 to 1.2.0
40
index.js
@@ -101,3 +101,6 @@ /** | ||
function gitWrapper(repo, args, cwd, callback) { | ||
var git = spawn('git', args, {cwd: cwd, stdout: 'ignore'}); | ||
var git = spawn('git', args, { | ||
cwd: cwd, | ||
stdout: 'ignore' | ||
}); | ||
var operation = args[0]; | ||
@@ -139,4 +142,5 @@ // print a nice status message "=== pull foo ===" | ||
]; | ||
if (options.branch) { | ||
ops.unshift(async.apply(gitWrapper, repo, ['checkout', options.branch], repo.to)); | ||
var branch = repo.branch || options.branch; | ||
if (branch) { | ||
ops.unshift(async.apply(gitWrapper, repo, ['checkout', branch], repo.to)); | ||
} | ||
@@ -156,5 +160,6 @@ async.series(ops, callback); | ||
]; | ||
if (options.branch) { | ||
var branch = repo.branch || options.branch; | ||
if (branch) { | ||
args.push('-b'); | ||
args.push(options.branch); | ||
args.push(branch); | ||
} | ||
@@ -168,7 +173,6 @@ gitWrapper(repo, args, path.dirname(repo.to), callback); | ||
var fn = async.seq( | ||
fs.readFile, | ||
function(data, callback) { | ||
fs.readFile, function(data, callback) { | ||
try { | ||
callback(null, JSON.parse(data)); | ||
} catch(e) { | ||
} catch (e) { | ||
callback(e, null); | ||
@@ -183,3 +187,5 @@ } | ||
var folders = []; | ||
configs = configs.reduce(function(a, b){ return a.concat(b); }); | ||
configs = configs.reduce(function(a, b) { | ||
return a.concat(b); | ||
}); | ||
configs.forEach(function(conf) { | ||
@@ -189,3 +195,7 @@ conf.repos.forEach(function(r) { | ||
var repoNames = githubToCheckout(r); | ||
repos.push({from: conf.org + '/' + repoNames[0] + '.git', to: path.join(conf.dir, repoNames[1])}); | ||
repos.push({ | ||
from: conf.org + '/' + repoNames[0] + '.git', | ||
to: path.join(conf.dir, repoNames[1]), | ||
branch: conf.branch | ||
}); | ||
}); | ||
@@ -224,6 +234,6 @@ }); | ||
], function(err) { | ||
if (err) { | ||
console.log(chalk.bold.red(String(err))); | ||
process.exit(1); | ||
} | ||
}); | ||
if (err) { | ||
console.log(chalk.bold.red(String(err))); | ||
process.exit(1); | ||
} | ||
}); |
{ | ||
"name": "bigstraw", | ||
"version": "1.1.3", | ||
"version": "1.2.0", | ||
"description": "Get a bunch of git resources, fast", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9218
9
251