Add production dependencies
This commit is contained in:
parent
5a0114f3e2
commit
579ccdc29f
12113 changed files with 978046 additions and 3 deletions
29
node_modules/gulp-git/lib/exec.js
generated
vendored
Normal file
29
node_modules/gulp-git/lib/exec.js
generated
vendored
Normal file
|
@ -0,0 +1,29 @@
|
|||
'use strict';
|
||||
|
||||
var log = require('fancy-log');
|
||||
var exec = require('child_process').exec;
|
||||
|
||||
module.exports = function (opt, cb) {
|
||||
if (!cb && typeof opt === 'function') {
|
||||
// optional options
|
||||
cb = opt;
|
||||
opt = {};
|
||||
}
|
||||
if (!cb || typeof cb !== 'function') cb = function () {};
|
||||
if (!opt) opt = { };
|
||||
if (!opt.log) opt.log = !cb;
|
||||
if (!opt.cwd) opt.cwd = process.cwd();
|
||||
if (!opt.maxBuffer) opt.maxBuffer = 200 * 1024; // Default buffer value for child_process.exec
|
||||
|
||||
if (!opt.args) opt.args = ' ';
|
||||
|
||||
var cmd = 'git ' + opt.args;
|
||||
return exec(cmd, {cwd : opt.cwd, maxBuffer: opt.maxBuffer}, function(err, stdout, stderr) {
|
||||
if (err) return cb(err, stderr);
|
||||
if (opt.log && !opt.quiet) log(cmd + '\n' + stdout, stderr);
|
||||
else {
|
||||
if (!opt.quiet) log(cmd + ' (log : false)', stderr);
|
||||
}
|
||||
cb(err, stdout);
|
||||
});
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue