Skip to content

Commit 15d8501

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 15d8501

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
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

0 commit comments

Comments
 (0)