Skip to content

Commit d465c9b

Browse files
authored
fix(cli): remove UTF-8 BOM from install.ps1 to fix irm | iex install (#787)
The BOM (EF BB BF) was being included as text by `irm`, causing PowerShell to try executing `#` as a command. Replace literal ✔ with `[char]0x2714` for PS5.1 compatibility without BOM, and add an irm simulation CI test to catch regressions.
1 parent 963316e commit d465c9b

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

.github/workflows/test-standalone-install.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,12 @@ jobs:
200200
run: |
201201
& ./packages/cli/install.ps1
202202
203+
- name: Run install.ps1 via irm simulation (catches BOM issues)
204+
shell: powershell
205+
run: |
206+
$ErrorActionPreference = "Stop"
207+
Get-Content ./packages/cli/install.ps1 -Raw | Invoke-Expression
208+
203209
- name: Set PATH
204210
shell: bash
205211
run: |

packages/cli/install.ps1

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Vite+ CLI Installer for Windows
1+
# Vite+ CLI Installer for Windows
22
# https://vite.plus/ps1
33
#
44
# Usage:
@@ -379,10 +379,11 @@ exec "`$VITE_PLUS_HOME/current/bin/vp.exe" "`$@"
379379
$DIM = "$e[2m"
380380
$BOLD_BRIGHT_BLUE = "$e[1;94m"
381381
$NC = "$e[0m"
382+
$CHECKMARK = [char]0x2714
382383

383384
# Print success message
384385
Write-Host ""
385-
Write-Host "${GREEN}${NC} ${BOLD_BRIGHT_BLUE}VITE+${NC} successfully installed!"
386+
Write-Host "${GREEN}${CHECKMARK}${NC} ${BOLD_BRIGHT_BLUE}VITE+${NC} successfully installed!"
386387
Write-Host ""
387388
Write-Host " The Unified Toolchain for the Web."
388389
Write-Host ""

0 commit comments

Comments
 (0)