UNPKG

@atomist/automation-client

Version:
20 lines 790 B
"use strict"; 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