Files
Pake/bin/utils/shell.ts
2025-01-23 14:14:22 +08:00

15 lines
386 B
TypeScript
Vendored

import { execa } from 'execa';
import { npmDirectory } from './dir';
export async function shellExec(command: string) {
try {
const { exitCode } = await execa(command, {
cwd: npmDirectory,
stdio: 'inherit'
});
return exitCode;
} catch (error) {
throw new Error(`Error occurred while executing command "${command}". Exit code: ${error.exitCode}`);
}
}