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
76 changes: 76 additions & 0 deletions .github/workflows/test-standalone-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,82 @@ jobs:
# cd hello && vp run build
"

test-install-ps1-v5:
name: Test install.ps1 (Windows x64, PowerShell 5.1)
runs-on: windows-latest
permissions:
contents: read
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1

- name: Assert PowerShell 5.x
shell: powershell
run: |
Write-Host "PowerShell version: $($PSVersionTable.PSVersion)"
if ($PSVersionTable.PSVersion.Major -ne 5) {
Write-Error "Expected PowerShell 5.x but got $($PSVersionTable.PSVersion)"
exit 1
}

- name: Run install.ps1
shell: powershell
run: |
& ./packages/cli/install.ps1

- name: Set PATH
shell: bash
run: |
echo "$USERPROFILE\.vite-plus\bin" >> $GITHUB_PATH

- name: Verify installation
shell: powershell
working-directory: ${{ runner.temp }}
run: |
Write-Host "PATH: $env:Path"
vp --version
vp --help
vp create vite --no-interactive --no-agent -- hello --no-interactive -t vanilla
cd hello
vp run build
vp --version

- name: Verify bin setup
shell: powershell
run: |
$binPath = "$env:USERPROFILE\.vite-plus\bin"
Get-ChildItem -Force $binPath
if (-not (Test-Path $binPath)) {
Write-Error "Bin directory not found: $binPath"
exit 1
}

$expectedShims = @("node.cmd", "npm.cmd", "npx.cmd")
foreach ($shim in $expectedShims) {
$shimFile = Join-Path $binPath $shim
if (-not (Test-Path $shimFile)) {
Write-Error "Shim not found: $shimFile"
exit 1
}
Write-Host "Found shim: $shimFile"
}
where.exe node
where.exe npm
where.exe npx
where.exe vp

$env:Path = "$env:USERPROFILE\.vite-plus\bin;$env:Path"
vp env doctor
vp env run --node 24 -- node -p "process.versions"

- name: Verify upgrade
shell: powershell
run: |
vp upgrade --check
vp upgrade 0.0.0-f74442ad.20260222-0755
vp --version
vp upgrade --rollback
vp --version

test-install-ps1:
name: Test install.ps1 (Windows x64)
runs-on: windows-latest
Expand Down
6 changes: 3 additions & 3 deletions packages/cli/install.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Vite+ CLI Installer for Windows
Comment thread
fengmk2 marked this conversation as resolved.
# Vite+ CLI Installer for Windows
# https://viteplus.dev/install.ps1
#
# Usage:
Expand Down Expand Up @@ -131,7 +131,7 @@ function Download-AndExtract {
& "$env:SystemRoot\System32\tar.exe" -xzf $tempFile -C $tempExtract

# Copy the specified file/directory
$sourcePath = Join-Path $tempExtract "package" $Filter
$sourcePath = Join-Path (Join-Path $tempExtract "package") $Filter
if (Test-Path $sourcePath) {
Copy-Item -Path $sourcePath -Destination $DestDir -Recurse -Force
}
Expand Down Expand Up @@ -293,7 +293,7 @@ function Main {
& "$env:SystemRoot\System32\tar.exe" -xzf $platformTempFile -C $platformTempExtract

# Copy binary to BinDir
$binarySource = Join-Path $platformTempExtract "package" $binaryName
$binarySource = Join-Path (Join-Path $platformTempExtract "package") $binaryName
if (Test-Path $binarySource) {
Copy-Item -Path $binarySource -Destination $BinDir -Force
}
Expand Down
Loading