Skip to content

Commit fcd4398

Browse files
Copilotbytemain
andauthored
Close pip shim file safely
Agent-Logs-Url: https://github.com/version-fox/vfox-python/sessions/fab67593-0eb0-42b0-b32e-e6f9fe3bf105 Co-authored-by: bytemain <13938334+bytemain@users.noreply.github.com>
1 parent 50a250d commit fcd4398

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

lib/util.lua

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -587,8 +587,13 @@ local function writeWindowsFile(path, content)
587587
if not file then
588588
error("Failed to write file: " .. path .. ". Error: " .. (err or "unknown"))
589589
end
590-
file:write(content)
590+
local ok, writeErr = pcall(function()
591+
file:write(content)
592+
end)
591593
file:close()
594+
if not ok then
595+
error("Failed to write file: " .. path .. ". Error: " .. tostring(writeErr))
596+
end
592597
end
593598

594599
local function createWindowsPipShim(scriptsPath)

0 commit comments

Comments
 (0)