@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.
39 lines (37 loc) • 838 B
JavaScript
// src/utilities/run.ts
import { exec, execSync } from "node:child_process";
var LARGE_BUFFER = 1024 * 1e6;
var run = (config, command, cwd = config.workspaceRoot ?? process.cwd(), stdio = "inherit", env = process.env) => {
return execSync(command, {
cwd,
env: {
...process.env,
...env,
CLICOLOR: "true",
FORCE_COLOR: "true"
},
windowsHide: true,
stdio,
maxBuffer: LARGE_BUFFER,
killSignal: "SIGTERM"
});
};
var runAsync = (config, command, cwd = config.workspaceRoot ?? process.cwd(), env = process.env) => {
return exec(command, {
cwd,
env: {
...process.env,
...env,
CLICOLOR: "true",
FORCE_COLOR: "true"
},
windowsHide: true,
maxBuffer: LARGE_BUFFER,
killSignal: "SIGTERM"
});
};
export {
LARGE_BUFFER,
run,
runAsync
};