Skip to content

fix: prompt to install dependencies in create #117

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/wise-trains-study.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'sv': patch
---

fix: prompt to install dependencies in `sv create`
2 changes: 1 addition & 1 deletion packages/cli/commands/add/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
6 changes: 4 additions & 2 deletions packages/cli/commands/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down