@atomist/automation-client
Version:
Atomist API for software low-level client
20 lines • 790 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const child_process_promise_1 = require("child-process-promise");
const logger_1 = require("../../internal/util/logger");
/**
* Run a child process as promise, with basic type information
* @param {string} cmd
* @param {"child_process".ExecOptions} opts
* @return {Promise<CommandResult>}
*/
function runCommand(cmd, opts) {
logger_1.logger.debug((opts.cwd ? opts.cwd : "") + " ==> " + cmd);
return child_process_promise_1.exec(cmd, Object.assign({ capture: ["stdout", "stderr"] }, opts))
.then(r => {
logger_1.logger.debug(r.stdout + r.stderr);
return Object.assign({}, r, { success: true });
});
}
exports.runCommand = runCommand;
//# sourceMappingURL=commandLine.js.map