@storm-software/config-tools
Version:
A package containing various utilities to support custom workspace configurations and environment management for Storm Software projects, including configuration file handling, environment variable management, and logging utilities.
41 lines (35 loc) • 1.2 kB
JavaScript
;Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }// src/utilities/run.ts
var _child_process = require('child_process');
var LARGE_BUFFER = 1024 * 1e6;
var run = (config, command, cwd = _nullishCoalesce(config.workspaceRoot, () => ( process.cwd())), stdio = "inherit", env = process.env) => {
return _child_process.execSync.call(void 0, command, {
cwd,
env: {
...process.env,
...env,
CLICOLOR: "true",
FORCE_COLOR: "true"
},
windowsHide: true,
stdio,
maxBuffer: LARGE_BUFFER,
killSignal: "SIGTERM",
encoding: "utf8"
});
};
var runAsync = (config, command, cwd = _nullishCoalesce(config.workspaceRoot, () => ( process.cwd())), env = process.env) => {
return _child_process.exec.call(void 0, command, {
cwd,
env: {
...process.env,
...env,
CLICOLOR: "true",
FORCE_COLOR: "true"
},
windowsHide: true,
maxBuffer: LARGE_BUFFER,
killSignal: "SIGTERM",
encoding: "utf8"
});
};
exports.LARGE_BUFFER = LARGE_BUFFER; exports.run = run; exports.runAsync = runAsync;