@@ -20,20 +20,21 @@ $InstallPath = if ($env:INSTALL_PATH) { $env:INSTALL_PATH } else { "$InstallDir\
2020
2121$DownloadUrl = " https://github.com/codecrafters-io/cli/releases/download/$Version /${Version} _windows_$Arch .tar.gz"
2222
23- Write-Host " This script will automatically install codecrafters ($Version ) for you."
24- Write-Host " Installation path: $InstallPath "
23+ Write-Host " Downloading " - NoNewline
24+ Write-Host " CodeCrafters CLI " - ForegroundColor Green - NoNewline
25+ Write-Host " ($Version )" - ForegroundColor DarkGray - NoNewline
26+ Write-Host " ..."
2527
2628$TempDir = Join-Path $env: TEMP " codecrafters-install-$ ( [System.Guid ]::NewGuid().ToString(' N' )) "
2729New-Item - ItemType Directory - Path $TempDir - Force | Out-Null
2830
2931try {
3032 $TarGzPath = Join-Path $TempDir " codecrafters.tar.gz"
31- Write-Host " Downloading CodeCrafters CLI..."
3233
3334 try {
3435 Invoke-WebRequest - Uri $DownloadUrl - OutFile $TarGzPath - UseBasicParsing
3536 } catch {
36- Write-Error " Failed to download. Your platform and architecture (windows-$Arch ) may be unsupported."
37+ Write-Host " error: your platform and architecture (windows-$Arch ) is unsupported."
3738 exit 1
3839 }
3940
@@ -47,15 +48,18 @@ try {
4748 Move-Item - Path $ExtractedBinary - Destination $InstallPath - Force
4849
4950 $InstalledVersion = & $InstallPath -- version
50- Write-Host " Installed $InstalledVersion "
5151
5252 $UserPath = [Environment ]::GetEnvironmentVariable(" Path" , " User" )
5353 if ($UserPath -notlike " *$InstallDir *" ) {
5454 $NewUserPath = if ($UserPath ) { " $UserPath ;$InstallDir " } else { $InstallDir }
5555 [Environment ]::SetEnvironmentVariable(" Path" , $NewUserPath , " User" )
5656 $env: Path += " ;$InstallDir "
5757 }
58- Write-Host " Done!"
58+
59+ Write-Host ([char ]0x2713 ) - ForegroundColor Green - NoNewline
60+ Write-Host " CodeCrafters CLI installed! " - NoNewline
61+ Write-Host " Version: $InstalledVersion " - ForegroundColor DarkGray
62+ Write-Host " "
5963} finally {
6064 # Cleanup
6165 if (Test-Path $TempDir ) {
0 commit comments