Files
Pake/bin/utils/shell.ts
2025-08-05 19:53:58 +08:00

17 lines
400 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}`,
);
}
}