Files
Pake/bin/utils/shell.ts
2023-04-11 10:33:28 +08:00

15 lines
379 B
TypeScript
Vendored

import shelljs from "shelljs";
import { npmDirectory } from "./dir.js";
export function shellExec(command: string) {
return new Promise<number>((resolve, reject) => {
shelljs.exec(command, { async: true, silent: false, cwd: npmDirectory}, (code) => {
if (code === 0) {
resolve(0);
} else {
reject(new Error(`${code}`));
}
});
});
}