🐛 format

This commit is contained in:
Tw93
2025-08-14 11:54:20 +08:00
parent 7b74b7fc15
commit 5853884cda
2 changed files with 6 additions and 3 deletions

View File

@@ -70,7 +70,10 @@ export default abstract class BaseBuilder {
timeout, timeout,
); );
} else { } else {
await shellExec(`cd "${npmDirectory}" && ${packageManager} install`, timeout); await shellExec(
`cd "${npmDirectory}" && ${packageManager} install`,
timeout,
);
} }
spinner.succeed(chalk.green('Package installed!')); spinner.succeed(chalk.green('Package installed!'));
if (!tauriTargetPathExists) { if (!tauriTargetPathExists) {

4
bin/utils/shell.ts vendored
View File

@@ -13,13 +13,13 @@ export async function shellExec(command: string, timeout: number = 300000) {
} catch (error: any) { } catch (error: any) {
const exitCode = error.exitCode ?? 'unknown'; const exitCode = error.exitCode ?? 'unknown';
const errorMessage = error.message || 'Unknown error occurred'; const errorMessage = error.message || 'Unknown error occurred';
if (error.timedOut) { if (error.timedOut) {
throw new Error( throw new Error(
`Command timed out after ${timeout}ms: "${command}". Try increasing timeout or check network connectivity.`, `Command timed out after ${timeout}ms: "${command}". Try increasing timeout or check network connectivity.`,
); );
} }
throw new Error( throw new Error(
`Error occurred while executing command "${command}". Exit code: ${exitCode}. Details: ${errorMessage}`, `Error occurred while executing command "${command}". Exit code: ${exitCode}. Details: ${errorMessage}`,
); );