IOweb/node_modules/@iconify/tools/lib/misc/exec.cjs
2026-07-03 15:07:38 -05:00

27 lines
556 B
JavaScript

'use strict';
const pathe = require('pathe');
const child_process = require('child_process');
function execAsync(cmd, options) {
return new Promise((fulfill, reject) => {
if (typeof options?.cwd === "string") {
options = {
...options,
cwd: pathe.resolve(options.cwd)
};
}
child_process.exec(cmd, options, (error, stdout, stderr) => {
if (error) {
reject(error);
} else {
fulfill({
stdout,
stderr
});
}
});
});
}
exports.execAsync = execAsync;