@zohodesk/client_build_tool
Version:
A CLI tool to build web applications and client libraries
38 lines (28 loc) • 1.02 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.defaultSpawnSyncOptions = void 0;
exports.spawnIO = spawnIO;
exports.spawnSyncIO = spawnSyncIO;
var _child_process = require("child_process");
var _logger = require("../../logger");
var _getCliPath = require("./getCliPath");
const defaultSpawnSyncOptions = {
stdio: 'inherit'
};
exports.defaultSpawnSyncOptions = defaultSpawnSyncOptions;
function spawnSyncIO(commandName, args, spawnSyncOptions = defaultSpawnSyncOptions) {
const command = (0, _getCliPath.getCliPath)(commandName);
const result = (0, _child_process.spawnSync)(command, args, spawnSyncOptions);
if (result.error || result.stderr) {
(0, _logger.errorLogger)(result.error || result.stderr);
}
return result;
}
function spawnIO(commandName, args, cb) {
const command = (0, _getCliPath.getCliPath)(commandName); // const result =
return (0, _child_process.spawn)(command, args, {
stdio: 'inherit'
}, cb); // process.exit(result.status);
}