🐛 update exec

This commit is contained in:
Tw93
2025-08-13 20:59:38 +08:00
parent ed4c7d0285
commit eefc02bd10
3 changed files with 11 additions and 5 deletions

7
bin/utils/shell.ts vendored
View File

@@ -6,11 +6,14 @@ export async function shellExec(command: string) {
const { exitCode } = await execa(command, {
cwd: npmDirectory,
stdio: 'inherit',
shell: true,
});
return exitCode;
} catch (error) {
} catch (error: any) {
const exitCode = error.exitCode ?? 'unknown';
const errorMessage = error.message || 'Unknown error occurred';
throw new Error(
`Error occurred while executing command "${command}". Exit code: ${error.exitCode}`,
`Error occurred while executing command "${command}". Exit code: ${exitCode}. Details: ${errorMessage}`,
);
}
}