Skip to content

Commit 769df24

Browse files
Copilotbytemain
andauthored
Improve pip shim error context
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 381e145 commit 769df24

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

lib/util.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -583,9 +583,9 @@ local function ensureWindowsDirectory(path)
583583
end
584584

585585
local function writeWindowsFile(path, content)
586-
local file = io.open(path, "w")
586+
local file, err = io.open(path, "w")
587587
if not file then
588-
error("Failed to write file: " .. path .. ". Check directory permissions and path validity.")
588+
error("Failed to write file: " .. path .. ". Error: " .. (err or "unknown"))
589589
end
590590
file:write(content)
591591
file:close()
@@ -594,7 +594,7 @@ end
594594
local function createWindowsPipShim(scriptsPath)
595595
ensureWindowsDirectory(scriptsPath)
596596

597-
-- Match the common pip script entry points created by ensurepip.
597+
-- pip and pip3 cover the command names exposed by vfox CI and common Windows usage.
598598
local shims = { "pip.cmd", "pip3.cmd" }
599599
for _, shim in ipairs(shims) do
600600
writeWindowsFile(scriptsPath .. "\\" .. shim, WINDOWS_PIP_SHIM_CONTENT)
@@ -643,7 +643,7 @@ local function ensureWindowsUvBuildPip(path)
643643
})
644644
local reinstallExitCode = os.execute(reinstallCommand)
645645
if not commandSucceeded(reinstallExitCode) then
646-
error("pip force-reinstall failed while creating pip scripts. Exit code: " .. tostring(reinstallExitCode))
646+
error("pip force-reinstall failed. Exit code: " .. tostring(reinstallExitCode))
647647
end
648648

649649
local verifyCommand = powerShellPythonCommand(pythonExe, { "-E", "-s", "-m", "pip", "--version" })

0 commit comments

Comments
 (0)