Skip to content

Commit 46173b2

Browse files
committed
fix: tolerate Windows short temp paths (fixes #838)
1 parent 4d6a1bd commit 46173b2

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

‎scripts/install.ps1‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1091,7 +1091,8 @@ Copy-Item -Path $DestBin -Destination $StableBin -Force
10911091
Set-Content -Path (Join-Path $BuildsDir "stable-version") -Value $VersionNum
10921092
Install-JcodeLauncher -SourcePath $StableBin -LauncherPath $LauncherPath | Out-Null
10931093
} finally {
1094-
Remove-Item -Path $TempDir -Recurse -Force -ErrorAction SilentlyContinue
1094+
Get-Item -LiteralPath $TempDir -ErrorAction SilentlyContinue |
1095+
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue
10951096
}
10961097

10971098
# Gracefully reload any running background server onto the freshly installed

‎scripts/test_windows_launcher_install.ps1‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,14 @@ try {
106106
$armManifest = "$digest nested/path/jcode-windows-aarch64.exe"
107107
Assert-Equal $digest (Get-JcodeSha256FromManifest -ManifestText $armManifest -AssetName 'jcode-windows-aarch64.exe') 'checksum parser should match the Windows ARM64 release asset'
108108

109+
Write-Host 'test_temp_cleanup_tolerates_windows_short_paths'
110+
$installText = Get-Content -LiteralPath $installScript -Raw
111+
Assert-True ($installText -match '(?m)^\s*Get-Item -LiteralPath \$TempDir -ErrorAction SilentlyContinue \|\r?\n\s*Remove-Item -Recurse -Force -ErrorAction SilentlyContinue\s*$') 'temporary cleanup should resolve the item before removal so Windows 8.3 TEMP paths are tolerated'
112+
109113
Write-Host 'test_optional_setup_and_source_build_are_opt_in'
110114
Assert-Equal $false ([bool]$ConfigureAlacritty) 'core install should not install an optional terminal by default'
111115
Assert-Equal $false ([bool]$ConfigureHotkey) 'core install should not add login persistence by default'
112116
Assert-Equal $false ([bool]$BuildFromSource) 'installer should not start a source build by default'
113-
$installText = Get-Content -LiteralPath $installScript -Raw
114117
Assert-True ($installText.Contains('will not start a long source build automatically')) 'missing release assets should produce an explicit source-build opt-in message'
115118
Assert-True ($installText.Contains('"--locked", "-p", "jcode", "--bin", "jcode"')) 'source-build fallback should compile only the locked jcode binary target'
116119

0 commit comments

Comments
 (0)