diff --git a/packages/shadcn/src/commands/init.ts b/packages/shadcn/src/commands/init.ts index fcd0e89170..28e6e2e002 100644 --- a/packages/shadcn/src/commands/init.ts +++ b/packages/shadcn/src/commands/init.ts @@ -305,6 +305,21 @@ export const init = new Command() } } + // Prompt for monorepo if the template supports it. + if ( + options.monorepo === undefined && + options.template && + templates[options.template as keyof typeof templates]?.monorepo + ) { + const { monorepo } = await prompts({ + type: "confirm", + name: "monorepo", + message: "Would you like to set up a monorepo?", + initial: false, + }) + options.monorepo = monorepo + } + // Prompt for base if not provided. if (!options.base) { options.base = await promptForBase() @@ -376,21 +391,6 @@ export const init = new Command() } } - // Prompt for monorepo if the template supports it. - if ( - options.monorepo === undefined && - options.template && - templates[options.template as keyof typeof templates]?.monorepo - ) { - const { monorepo } = await prompts({ - type: "confirm", - name: "monorepo", - message: "Would you like to set up a monorepo?", - initial: false, - }) - options.monorepo = monorepo - } - // Resolve base: --base flag > preset/prompt/URL > existing config > prompt. let resolvedBase: string = options.base ??