diff --git a/bin/builders/BaseBuilder.ts b/bin/builders/BaseBuilder.ts index 024e563..f6c1445 100644 --- a/bin/builders/BaseBuilder.ts +++ b/bin/builders/BaseBuilder.ts @@ -70,7 +70,10 @@ export default abstract class BaseBuilder { timeout, ); } else { - await shellExec(`cd "${npmDirectory}" && ${packageManager} install`, timeout); + await shellExec( + `cd "${npmDirectory}" && ${packageManager} install`, + timeout, + ); } spinner.succeed(chalk.green('Package installed!')); if (!tauriTargetPathExists) { diff --git a/bin/utils/shell.ts b/bin/utils/shell.ts index 3eda775..0a743b5 100644 --- a/bin/utils/shell.ts +++ b/bin/utils/shell.ts @@ -13,13 +13,13 @@ export async function shellExec(command: string, timeout: number = 300000) { } catch (error: any) { const exitCode = error.exitCode ?? 'unknown'; const errorMessage = error.message || 'Unknown error occurred'; - + if (error.timedOut) { throw new Error( `Command timed out after ${timeout}ms: "${command}". Try increasing timeout or check network connectivity.`, ); } - + throw new Error( `Error occurred while executing command "${command}". Exit code: ${exitCode}. Details: ${errorMessage}`, );