We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0676a21 commit 2d50507Copy full SHA for 2d50507
tasks/util/common.js
@@ -1,10 +1,13 @@
1
var fs = require('fs');
2
var exec = require('child_process').exec;
3
4
-exports.execCmd = function(cmd, cb) {
+exports.execCmd = function(cmd, cb, errorCb) {
5
+ cb = cb ? cb : function() {};
6
+ errorCb = errorCb ? errorCb : function(err) { if(err) throw err; };
7
+
8
exec(cmd, function(err) {
- if(err) throw err;
- if(cb) cb();
9
+ errorCb(err);
10
+ cb();
11
})
12
.stdout.pipe(process.stdout);
13
};
0 commit comments