diff --git a/.changeset/wise-trains-study.md b/.changeset/wise-trains-study.md new file mode 100644 index 00000000..4dc350af --- /dev/null +++ b/.changeset/wise-trains-study.md @@ -0,0 +1,5 @@ +--- +'sv': patch +--- + +fix: prompt to install dependencies in `sv create` diff --git a/packages/cli/commands/add/index.ts b/packages/cli/commands/add/index.ts index 3c0f27a4..dc6ed673 100644 --- a/packages/cli/commands/add/index.ts +++ b/packages/cli/commands/add/index.ts @@ -452,7 +452,7 @@ export async function runAddCommand(options: Options, adders: string[]): Promise } // install dependencies - let depsStatus: 'installed' | 'skipped' | undefined; + let depsStatus: 'installed' | 'skipped' = 'skipped'; if (options.install && selectedAdders.length > 0) { depsStatus = await common.suggestInstallingDependencies(options.cwd); } diff --git a/packages/cli/commands/create.ts b/packages/cli/commands/create.ts index ff99c253..30f2d6c7 100644 --- a/packages/cli/commands/create.ts +++ b/packages/cli/commands/create.ts @@ -138,10 +138,12 @@ async function createProject(cwd: string, options: Options) { if (options.adders) { await runAddCommand( - { cwd: projectPath, install: options.install, preconditions: true, community: [] }, + { cwd: projectPath, install: false, preconditions: true, community: [] }, [] ); - } else if (options.install) { + } + // show install prompt even if no adders selected + if (options.install) { // `runAddCommand` includes the installing dependencies prompt. if it's skipped, // then we'll prompt to install dependencies here await common.suggestInstallingDependencies(projectPath);