@@ -140,7 +140,8 @@ function Download-AndExtract {
140140
141141 $tempFile = New-TemporaryFile
142142 try {
143- # Progress bar is shown by default with Invoke-WebRequest
143+ # Suppress progress bar for cleaner output
144+ $ProgressPreference = ' SilentlyContinue'
144145 Invoke-WebRequest - Uri $Url - OutFile $tempFile
145146
146147 # Create temp extraction directory
@@ -179,24 +180,24 @@ function Cleanup-OldVersions {
179180 Select-Object - First ($versions.Count - $maxVersions )
180181
181182 foreach ($old in $toDelete ) {
182- Write-Info " Removing old version: $ ( $old .Name ) "
183+ # Remove silently
183184 Remove-Item - Path $old.FullName - Recurse - Force
184185 }
185186}
186187
187188function Main {
188189 Write-Host " "
189- Write-Host " VITE+(⚡︎) Installer "
190+ Write-Host " Setting up VITE+(⚡︎)... "
190191 Write-Host " "
191192
193+ # Suppress progress bars for cleaner output
194+ $ProgressPreference = ' SilentlyContinue'
195+
192196 $arch = Get-Architecture
193197 $platform = " win32-$arch "
194- Write-Info " Detected platform: $platform "
195198
196199 # Fetch package metadata and resolve version
197- Write-Info " Fetching package metadata..."
198200 $ViteVersion = Get-VersionFromMetadata
199- Write-Info " Installing vite-plus-cli v$ViteVersion "
200201
201202 # Set up version-specific directories
202203 $VersionDir = " $InstallDir \$ViteVersion "
@@ -215,11 +216,9 @@ function Main {
215216
216217 # Download and extract native binary and .node files from platform package
217218 $platformUrl = " $NpmRegistry /$packageName /-/vite-plus-cli-$packageSuffix -$ViteVersion .tgz"
218- Write-Info " Downloading platform package..."
219219
220220 $platformTempFile = New-TemporaryFile
221221 try {
222- # Progress bar is shown by default with Invoke-WebRequest
223222 Invoke-WebRequest - Uri $platformUrl - OutFile $platformTempFile
224223
225224 # Create temp extraction directory
@@ -252,11 +251,9 @@ function Main {
252251
253252 # Download and extract JS bundle
254253 $mainUrl = " $NpmRegistry /vite-plus-cli/-/vite-plus-cli-$ViteVersion .tgz"
255- Write-Info " Downloading JS scripts..."
256254
257255 $mainTempFile = New-TemporaryFile
258256 try {
259- # Progress bar is shown by default with Invoke-WebRequest
260257 Invoke-WebRequest - Uri $mainUrl - OutFile $mainTempFile
261258
262259 # Create temp extraction directory
@@ -289,7 +286,6 @@ function Main {
289286 $pkg | ConvertTo-Json - Depth 10 | Set-Content $pkgFile
290287
291288 # Install production dependencies
292- Write-Info " Installing dependencies..."
293289 Push-Location $VersionDir
294290 try {
295291 $env: CI = " true"
@@ -310,10 +306,7 @@ function Main {
310306 # Cleanup old versions
311307 Cleanup- OldVersions - InstallDir $InstallDir
312308
313- Write-Success " Vite+ CLI installed to $VersionDir "
314-
315309 # Update PATH
316- Write-Host " "
317310 $pathToAdd = " $InstallDir \current\bin"
318311 $userPath = [Environment ]::GetEnvironmentVariable(" Path" , " User" )
319312
@@ -327,19 +320,28 @@ function Main {
327320 $newPath = " $pathToAdd ;$userPath "
328321 [Environment ]::SetEnvironmentVariable(" Path" , $newPath , " User" )
329322 $env: Path = " $pathToAdd ;$env: Path "
330- Write-Success " PATH has been updated"
331- Write-Host " "
332- Write-Host " Restart your terminal to use vp, or run:"
333- Write-Host " "
334- Write-Host " `$ env:Path = `" $pathToAdd ;`$ env:Path`" "
335- } else {
336- Write-Info " PATH already contains $pathToAdd "
337323 }
338324
325+ # Print success message
326+ Write-Host " "
327+ Write-Host " ✔ " - ForegroundColor Green - NoNewline
328+ Write-Host " VITE+(⚡︎) successfully installed!"
339329 Write-Host " "
340- Write-Host " Then run: "
330+ Write-Host " Version: $ViteVersion "
341331 Write-Host " "
342- Write-Host " vp --version"
332+ # Use ~ shorthand if install dir is under USERPROFILE, otherwise show full path
333+ $displayDir = $InstallDir -replace [regex ]::Escape($env: USERPROFILE ), ' ~'
334+ Write-Host " Location: $displayDir \current\bin"
335+ Write-Host " "
336+ Write-Host " Next: Run vp --help to get started"
337+
338+ # Show note if PATH was updated
339+ if ($needsPathUpdate ) {
340+ Write-Host " "
341+ Write-Host " Note: Restart your terminal or run:"
342+ Write-Host " `$ env:Path = `" $pathToAdd ;`$ env:Path`" "
343+ }
344+
343345 Write-Host " "
344346}
345347
0 commit comments