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
35 changes: 35 additions & 0 deletions .github/workflows/test-standalone-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,41 @@
vp upgrade --rollback
vp --version

test-install-sh-readonly-config:
name: Test install.sh (readonly shell config)
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1

Check notice

Code scanning / zizmor

credential persistence through GitHub Actions artifacts Note test

credential persistence through GitHub Actions artifacts

- name: Make shell config files read-only
run: |
# Simulate Nix-managed or read-only shell configs
touch ~/.bashrc ~/.bash_profile ~/.profile
chmod 444 ~/.bashrc ~/.bash_profile ~/.profile

- name: Run install.sh
run: |
output=$(cat packages/cli/install.sh | bash 2>&1) || {
echo "$output"
echo "Install script exited with non-zero status"
exit 1
}
echo "$output"
# Verify installation succeeds (not a fatal error)
echo "$output" | grep -q "successfully installed"
# Verify fallback message shows binary location
echo "$output" | grep -q "vp was installed to:"
# Verify fallback message shows manual instructions
echo "$output" | grep -q "Or run vp directly:"
# Verify the permission warning was shown
echo "$output" | grep -qi "permission denied"

- name: Verify vp works via direct path
run: |
~/.vite-plus/bin/vp --version

test-install-sh-arm64:
name: Test install.sh (Linux ARM64 glibc via QEMU)
runs-on: ubuntu-latest
Expand Down
20 changes: 19 additions & 1 deletion packages/cli/install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,8 @@ function Configure-UserPath {
$env:Path = "$binPath;$env:Path"
return "true"
} catch {
Write-Error-Exit "Cannot update user PATH. Please check your system permissions and re-run the installer."
Write-Warn "Could not update user PATH automatically."
return "failed"
}
}

Expand Down Expand Up @@ -428,6 +429,7 @@ exec "`$VITE_PLUS_HOME/current/bin/vp.exe" "`$@"
# ANSI color codes for consistent output
$e = [char]27
$GREEN = "$e[32m"
$YELLOW = "$e[33m"
$BRIGHT_BLUE = "$e[94m"
$BOLD = "$e[1m"
$DIM = "$e[2m"
Expand Down Expand Up @@ -463,6 +465,22 @@ exec "`$VITE_PLUS_HOME/current/bin/vp.exe" "`$@"
Write-Host " Note: Restart your terminal and IDE for changes to take effect."
}

# Show manual PATH instructions if PATH could not be configured
if ($pathResult -eq "failed") {
Write-Host ""
Write-Host " ${YELLOW}note${NC}: Could not automatically add vp to your PATH."
Write-Host ""
Write-Host " vp was installed to: ${BOLD}${displayDir}\bin${NC}"
Write-Host ""
Write-Host " To use vp, manually add it to your PATH:"
Write-Host ""
Write-Host " [Environment]::SetEnvironmentVariable('Path', '$InstallDir\bin;' + [Environment]::GetEnvironmentVariable('Path', 'User'), 'User')"
Write-Host ""
Write-Host " Or run vp directly:"
Write-Host ""
Write-Host " & `"$InstallDir\bin\vp.exe`""
}

Write-Host ""
}

Expand Down
6 changes: 6 additions & 0 deletions packages/cli/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -721,6 +721,8 @@ NPMRC_EOF
echo ""
echo -e " ${YELLOW}note${NC}: Could not automatically add vp to your PATH."
echo ""
echo -e " vp was installed to: ${BOLD}${display_location}${NC}"
echo ""
echo " To use vp, add this line to your shell config file:"
echo ""
echo " . \"$INSTALL_DIR_REF/env\""
Expand All @@ -729,6 +731,10 @@ NPMRC_EOF
echo " - Bash: ~/.bashrc or ~/.bash_profile"
echo " - Zsh: ~/.zshrc"
echo " - Fish: source \"$INSTALL_DIR_REF/env.fish\" in ~/.config/fish/config.fish"
echo ""
echo " Or run vp directly:"
echo ""
echo -e " ${display_location}/vp"
fi

echo ""
Expand Down
Loading