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