🐛 update exec
This commit is contained in:
7
bin/utils/shell.ts
vendored
7
bin/utils/shell.ts
vendored
@@ -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}`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user