Skip to content

Commit f4ce68d

Browse files
Copilotbytemain
andauthored
Format Windows pip install commands
Agent-Logs-Url: https://github.com/version-fox/vfox-python/sessions/07e4e50a-f299-4a36-a8b8-405f0222677a Co-authored-by: bytemain <13938334+bytemain@users.noreply.github.com>
1 parent 3505884 commit f4ce68d

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

lib/util.lua

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ end
1414
local version_vault_url = "https://vault.vfox.dev/python/pyenv"
1515
local uv_build_vault_url = "https://vault.vfox.dev/python/uv-build"
1616
local UV_BUILD_GITHUB_RELEASE_PATTERN = "/releases/download/([^/]+)/([^/]+)$"
17-
local WINDOWS_NULL_REDIRECT = "> NUL"
17+
local windows_null_redirect = "> NUL"
1818

1919
-- request headers
2020
local REQUEST_HEADERS = {
@@ -592,7 +592,8 @@ local function ensureWindowsUvBuildPip(path)
592592
end
593593

594594
print("Installing pip...")
595-
local command = shellQuote(pythonExe) .. " -E -s -m ensurepip -U --default-pip " .. WINDOWS_NULL_REDIRECT
595+
local command = string.format("%s -E -s -m ensurepip -U --default-pip %s",
596+
shellQuote(pythonExe), windows_null_redirect)
596597
local exitCode = os.execute(command)
597598
if not commandSucceeded(exitCode) then
598599
error("ensurepip failed while installing pip. exit " .. tostring(exitCode))
@@ -603,8 +604,8 @@ local function ensureWindowsUvBuildPip(path)
603604
end
604605

605606
local quotedBundledPath = shellQuote(path .. "\\Lib\\ensurepip\\_bundled")
606-
command = shellQuote(pythonExe) .. " -E -s -m pip install --force-reinstall --no-index" ..
607-
" --find-links " .. quotedBundledPath .. " pip " .. WINDOWS_NULL_REDIRECT
607+
command = string.format("%s -E -s -m pip install --force-reinstall --no-index --find-links %s pip %s",
608+
shellQuote(pythonExe), quotedBundledPath, windows_null_redirect)
608609
exitCode = os.execute(command)
609610
if not commandSucceeded(exitCode) then
610611
error("pip force-reinstall failed while creating pip scripts. exit " .. tostring(exitCode))

0 commit comments

Comments
 (0)