Skip to content

Commit 0fcfe11

Browse files
committed
feat: clone specific pyenv branch
1 parent b42ae8a commit 0fcfe11

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

lib/util.lua

+11-1
Original file line numberDiff line numberDiff line change
@@ -211,13 +211,19 @@ function windowsInstallExe(path, url, version, filename)
211211

212212
end
213213

214+
local pyenvBranch = ""
215+
214216
function linuxCompile(ctx)
215217
local sdkInfo = ctx.sdkInfo['python']
216218
local path = sdkInfo.path
217219
local version = sdkInfo.version
218220
local pyenv_url = "https://github.com/pyenv/pyenv.git"
219221
local dest_pyenv_path = ctx.rootPath .. "/pyenv"
220-
local status = os.execute("git clone --depth 1 " .. pyenv_url .. " " .. dest_pyenv_path)
222+
local branch = ""
223+
if pyenvBranch ~= "" then
224+
branch = "--branch " .. pyenvBranch
225+
end
226+
local status = os.execute("git -c advice.detachedHead=false clone --depth 1 " .. branch .. " " .. pyenv_url .. " " .. dest_pyenv_path)
221227
if status ~= 0 then
222228
error("git clone failed")
223229
end
@@ -343,6 +349,10 @@ function parseVersionFromPyenv()
343349
local jsonObj = json.decode(resp.body)
344350

345351
local tagName = jsonObj.tagName;
352+
if tagName then
353+
pyenvBranch = tagName;
354+
end
355+
346356
local versions = jsonObj.versions;
347357

348358
local numericVersions = {}

0 commit comments

Comments
 (0)