Skip to content
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/tall-moons-marry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'sv': patch
---

fix: package manager detection in non interactive environments
4 changes: 4 additions & 0 deletions packages/cli/utils/package-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ export async function packageManagerPrompt(cwd: string): Promise<AgentName | und
const detected = await detect({ cwd });
const agent = detected?.name ?? getUserAgent();

// If we are in a non interactive environment just go with the detected package manager.
// There is no need to prompt in that case.
if (!process.stdout.isTTY) return agent;

const pm = await p.select({
message: 'Which package manager do you want to install dependencies with?',
options: agentOptions,
Expand Down