aboutsummaryrefslogtreecommitdiff
path: root/packages/create-astro/src
diff options
context:
space:
mode:
Diffstat (limited to 'packages/create-astro/src')
-rw-r--r--packages/create-astro/src/actions/dependencies.ts19
-rw-r--r--packages/create-astro/src/messages.ts1
2 files changed, 10 insertions, 10 deletions
diff --git a/packages/create-astro/src/actions/dependencies.ts b/packages/create-astro/src/actions/dependencies.ts
index 1e731099c..e920fcf8e 100644
--- a/packages/create-astro/src/actions/dependencies.ts
+++ b/packages/create-astro/src/actions/dependencies.ts
@@ -27,17 +27,16 @@ export async function dependencies(
await spinner({
start: `Installing dependencies with ${ctx.packageManager}...`,
end: 'Dependencies installed',
- while: () => {
- return install({ packageManager: ctx.packageManager, cwd: ctx.cwd }).catch((e) => {
- error('error', e);
- error(
- 'error',
- `Dependencies failed to install, please run ${color.bold(
- ctx.packageManager + ' install'
- )} to install them manually after setup.`
- );
- });
+ onError: (e) => {
+ error('error', e);
+ error(
+ 'error',
+ `Dependencies failed to install, please run ${color.bold(
+ ctx.packageManager + ' install'
+ )} to install them manually after setup.`
+ );
},
+ while: () => install({ packageManager: ctx.packageManager, cwd: ctx.cwd }),
});
} else {
await info(
diff --git a/packages/create-astro/src/messages.ts b/packages/create-astro/src/messages.ts
index 29c551883..09675740a 100644
--- a/packages/create-astro/src/messages.ts
+++ b/packages/create-astro/src/messages.ts
@@ -31,6 +31,7 @@ export async function say(messages: string | string[], { clear = false, hat = ''
export async function spinner(args: {
start: string;
end: string;
+ onError?: (error: any) => void;
while: (...args: any) => Promise<any>;
}) {
await load(args, { stdout });