UNPKG

jack-cli

Version:

Chop through that Git log wicked fast!

26 lines 1.07 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var child_process_1 = require("child_process"); exports.promisifyChildProcess = function (childProcess) { return new Promise(function (resolve, reject) { var dataString = ''; var errorString = ''; childProcess.stdout.setEncoding('utf8'); childProcess.stderr.setEncoding('utf8'); childProcess.stdout.on('data', function (data) { return (dataString += data); }); childProcess.stderr.on('data', function (data) { return (errorString += data); }); childProcess.on('close', function (code) { if (code === 0) { resolve(dataString.trim()); } else { reject(new Error(errorString.trim())); } }); }); }; exports.spawnPromise = function (command, args, config) { if (config === void 0) { config = {}; } return exports.promisifyChildProcess(child_process_1.spawn(command, args, config)); }; //# sourceMappingURL=promisify-child-process.js.map