function execHelper()

in src/executil.js [42:64]


function execHelper (cmdAndArgs, silent, allowError, win, fail) {
    // there are times where we want silent but not allowError.
    if (allowError == null) {
        // default to allow failure if being silent.
        allowError = allowError || silent;
    }
    if (/^git commit/.exec(cmdAndArgs.join(' '))) {
        gitCommitCount++;
    }
    cmdAndArgs[0] = cmdAndArgs[0].replace(/^git /, 'git -c color.ui=always ');
    if (!silent || silent === 3 || exports.verbose) {
        apputil.print('Executing:', cmdAndArgs.join(' '));
    }
    const result = superspawn.spawn(cmdAndArgs[0], cmdAndArgs.slice(1), { stdio: (silent && (silent !== 2)) ? 'default' : 'inherit' });
    return result.then(win || null, fail || function (e) {
        if (allowError) {
            throw e;
        } else if (+silent !== 1) {
            apputil.print(e.output);
        }
        process.exit(2);
    });
}