sda
Version:
Software development assistant
33 lines • 1.33 kB
JavaScript
;
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const child_process = __importStar(require("child_process"));
const Log_1 = __importDefault(require("../Log"));
const MAX_BUFFER = 20 * 1024 * 1024; // 20 MB
function syncExecuteCommands(commands, environment, ec) {
for (const command of commands) {
executeCommand(command, environment, ec);
}
}
exports.default = syncExecuteCommands;
function executeCommand(command, environment, ec) {
Log_1.default.verbose(`Executing command "${command.id}" in environment "${environment.id}"`);
for (const cmd of command.cmd) {
child_process.execSync(cmd, {
cwd: command.cwd,
stdio: ec.isSilent ? 'ignore' : 'inherit',
maxBuffer: MAX_BUFFER,
timeout: command.timeout
});
}
}
//# sourceMappingURL=syncExecuteCommands.js.map