Skip to content

Commit d7b9b6a

Browse files
committed
fix(cli): scope CI env var to child process in Windows install script (#1292)
Use `cmd /c "set CI=true && ..."` instead of setting `$env:CI` directly, so the variable is scoped to the child process and does not persist in the user's PowerShell session. This prevented `vp create` from entering interactive mode when run in the same terminal after installation. Closes #1288
1 parent 3a1b440 commit d7b9b6a

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

packages/cli/install.ps1

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,8 +374,9 @@ function Main {
374374
$installLog = Join-Path $VersionDir "install.log"
375375
Push-Location $VersionDir
376376
try {
377-
$env:CI = "true"
378-
& "$BinDir\vp.exe" install --silent *> $installLog
377+
# Use cmd /c so CI=true is scoped to the child process only,
378+
# avoiding leaking it into the user's shell session.
379+
cmd /c "set CI=true && `"$BinDir\vp.exe`" install --silent" *> $installLog
379380
if ($LASTEXITCODE -ne 0) {
380381
Write-Host "error: Failed to install dependencies. See log for details: $installLog" -ForegroundColor Red
381382
exit 1

packages/cli/snap-tests-global/new-vite-monorepo-bun/snap.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ website
6666
"preview": "vp preview"
6767
},
6868
"devDependencies": {
69-
"typescript": "~5.9.3",
69+
"typescript": "~6.0.2",
7070
"vite": "catalog:",
7171
"vite-plus": "catalog:"
7272
}

0 commit comments

Comments
 (0)