UNPKG

@process-engine/ci_tools

Version:
22 lines 721 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.escapeForShell = exports.asyncSh = exports.sh = void 0; const shell = require("shelljs"); function sh(command) { const result = shell.exec(`${command} 2>&1`, { silent: true }); return result.stdout; } exports.sh = sh; function asyncSh(command) { return new Promise((resolve, reject) => { shell.exec(`${command} 2>&1`, { silent: true, async: true }, (code, stdout, stderr) => { return resolve(stdout); }); }); } exports.asyncSh = asyncSh; function escapeForShell(text) { return text.replace(/(`|\$|")/g, '\\$1'); } exports.escapeForShell = escapeForShell; //# sourceMappingURL=shell.js.map