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

25 lines
503 B
JavaScript

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