@@ -61,17 +61,17 @@ function PLUGIN:PostInstall(ctx)
6161
6262 -- Install LuaRocks for Lua 5.x
6363 if major and major >= 5 then
64- -- Get latest LuaRocks version from GitHub
64+ -- Get latest LuaRocks version from GitHub releases
6565 local luarocksVersion = " 3.11.1" -- Default fallback
6666
6767 local resp , err = http .get ({
68- url = " https://api.github.com/repos/luarocks/luarocks/tags?per_page=1 " ,
68+ url = " https://api.github.com/repos/luarocks/luarocks/releases/latest " ,
6969 })
7070
7171 if err == nil and resp .status_code == 200 then
7272 local data = json .decode (resp .body )
73- if data ~= nil and type (data ) == " table" and # data > 0 then
74- local tag = data [1 ][ " name " ]
73+ if data ~= nil and type (data ) == " table" then
74+ local tag = data [" tag_name " ]
7575 if tag then
7676 -- Remove 'v' prefix if present
7777 luarocksVersion = string.gsub (tag , " ^v" , " " )
@@ -80,7 +80,7 @@ function PLUGIN:PostInstall(ctx)
8080 end
8181
8282 -- Download and install LuaRocks
83- local luarocksUrl = " https://luarocks.org/releases /luarocks- " .. luarocksVersion .. " .tar.gz"
83+ local luarocksUrl = " https://github.com/luarocks /luarocks/archive/refs/tags/v " .. luarocksVersion .. " .tar.gz"
8484 local luarocksArchive = sdkPath .. " /luarocks.tar.gz"
8585
8686 local downloadCmd = string.format (" curl -sL '%s' -o '%s'" , luarocksUrl , luarocksArchive )
0 commit comments