Add production dependencies
This commit is contained in:
parent
5a0114f3e2
commit
579ccdc29f
12113 changed files with 978046 additions and 3 deletions
30
node_modules/gulp-git/lib/branch.js
generated
vendored
Normal file
30
node_modules/gulp-git/lib/branch.js
generated
vendored
Normal file
|
@ -0,0 +1,30 @@
|
|||
'use strict';
|
||||
|
||||
var log = require('fancy-log');
|
||||
var exec = require('child_process').exec;
|
||||
var escape = require('any-shell-escape');
|
||||
|
||||
// want to get the current branch instead?
|
||||
// git.revParse({args:'--abbrev-ref HEAD'})
|
||||
|
||||
module.exports = function (branch, opt, cb) {
|
||||
if (!cb && typeof opt === 'function') {
|
||||
// optional options
|
||||
cb = opt;
|
||||
opt = {};
|
||||
}
|
||||
if (!cb || typeof cb !== 'function') cb = function () {};
|
||||
if (!opt) opt = {};
|
||||
if (!branch) return cb(new Error('gulp-git: Branch name is required git.branch("name")'));
|
||||
if (!opt.cwd) opt.cwd = process.cwd();
|
||||
if (!opt.args) opt.args = ' ';
|
||||
|
||||
var maxBuffer = opt.maxBuffer || 200 * 1024;
|
||||
|
||||
var cmd = 'git branch ' + opt.args + ' ' + escape([branch]);
|
||||
return exec(cmd, {cwd: opt.cwd, maxBuffer: maxBuffer}, function(err, stdout, stderr) {
|
||||
if (err) return cb(err);
|
||||
if (!opt.quiet) log(stdout, stderr);
|
||||
cb(null, stdout);
|
||||
});
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue