shell: add options to exec
This commit is contained in:
+3
-2
@@ -21,14 +21,15 @@ exports = module.exports = {
|
||||
|
||||
const SUDO = '/usr/bin/sudo';
|
||||
|
||||
function exec(tag, cmd, callback) {
|
||||
function exec(tag, cmd, options, callback) {
|
||||
assert.strictEqual(typeof tag, 'string');
|
||||
assert.strictEqual(typeof cmd, 'string');
|
||||
assert.strictEqual(typeof options, 'object');
|
||||
assert.strictEqual(typeof callback, 'function');
|
||||
|
||||
debug(`${tag} exec: ${cmd}`);
|
||||
|
||||
child_process.exec(cmd, function (error, stdout, stderr) {
|
||||
child_process.exec(cmd, options, function (error, stdout, stderr) {
|
||||
const stdoutResult = stdout ? stdout.toString('utf8') : null;
|
||||
const stderrResult = stderr ? stderr.toString('utf8') : null;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user