summaryrefslogtreecommitdiff
path: root/node_modules/electron-notarize/lib/spawn.js
blob: 505e34ae3b3a04b3e3161d1f36c671ce11521464 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Object.defineProperty(exports, "__esModule", { value: true });
const child_process_1 = require("child_process");
const debug = require("debug");
const helpers_1 = require("./helpers");
const d = debug('electron-notarize:spawn');
exports.spawn = (cmd, args = [], opts = {}) => {
    d('spawning cmd:', cmd, 'args:', args.map(arg => (helpers_1.isSecret(arg) ? '*********' : arg)), 'opts:', opts);
    const child = child_process_1.spawn(cmd, args, opts);
    const out = [];
    const dataHandler = (data) => out.push(data.toString());
    child.stdout.on('data', dataHandler);
    child.stderr.on('data', dataHandler);
    return new Promise(resolve => {
        child.on('exit', code => {
            d(`cmd ${cmd} terminated with code: ${code}`);
            resolve({
                code,
                output: out.join(''),
            });
        });
    });
};
//# sourceMappingURL=spawn.js.map