Skip to content

Commit 8c9bcf1

Browse files
committed
fix(upgrade): delete old location if already exists
1 parent 392a81e commit 8c9bcf1

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

packages/lde/src/commands/upgrade.lua

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,11 @@ local function upgrade(args)
115115
return
116116
end
117117

118+
-- Remove any leftover .old binary from a previous upgrade (Windows rename fails if dest exists)
119+
if fs.exists(tempOldLocation) then
120+
fs.delete(tempOldLocation)
121+
end
122+
118123
-- Move current executable to tmp (allows replacement even if running)
119124
local moveOldSuccess, moveOldErr = fs.move(binLocation, tempOldLocation)
120125
if not moveOldSuccess then

0 commit comments

Comments
 (0)