You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
install.ps1 aborts on upgrade: File.Replace rejects the null backup path #1354
Upgrading an existing Windows install with the documented one-liner aborts at the last step, after the
binary and PATH are already in place, and leaves ~/.config/thinkrail/install.json describing the
previous version.
The second install replaces install.json with the new version and prints its closing lines.
Actual behavior
Install-ThinkRail writes the metadata with:
if (Test-Path-LiteralPath $metaFile) {
[System.IO.File]::Replace($metaTemp,$metaFile,$null)
} else {
[System.IO.File]::Move($metaTemp,$metaFile)
}
PowerShell binds $null to the string parameter as an empty string, so File.Replace receives ""
as the backup path instead of "no backup" and rejects it. PowerShell 7 reports The path is empty;
Windows PowerShell 5.1 reports The path is not of a legal form for the same call.
Only the Replace branch runs when install.json already exists, so a first install succeeds and every
install over an existing one fails at the last step.
Fix: pass a real null, [System.IO.File]::Replace($metaTemp, $metaFile, [NullString]::Value). [NullString]::Value exists in both Windows PowerShell 5.1 and PowerShell 7.
Environment
OS: Windows 11 x64
Bun version (bun --version): 1.4.4
Node version (node --version): v26.13.0
ThinkRail version / commit: 0.4.0 (stable), upgrading from 0.3.2; PowerShell 7.6.9, also reproduced
under Windows PowerShell 5.1
Activity