Skip to content

Commit

Permalink
fix: If the OS is Linux, add lib_c_type=glibc. (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
herouu committed Apr 28, 2024
1 parent 0e50f86 commit d99e8d8
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions lib/foojay.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ local json = require("json")
local foojay = {}

local URL =
"https://api.foojay.io/disco/v3.0/packages/jdks?version=%s&distribution=%s&architecture=%s&archive_type=%s&operating_system=%s&release_status=ga&directly_downloadable=true&latest=available"
"https://api.foojay.io/disco/v3.0/packages/jdks?version=%s&distribution=%s&architecture=%s&archive_type=%s&operating_system=%s&lib_c_type=%s&release_status=ga&directly_downloadable=true&latest=available"

foojay.fetchtJdkList= function (distribution, version)

Expand All @@ -17,7 +17,13 @@ foojay.fetchtJdkList= function (distribution, version)
if os == "windows" then
archive_type = "zip"
end
local reqUrl = URL:format(version,distribution,RUNTIME.archType, archive_type, os)

local lib_c_type = ""
if os == "linux" then
lib_c_type = "glibc"
end

local reqUrl = URL:format(version, distribution, RUNTIME.archType, archive_type, os, lib_c_type)

local resp, err = http.get({
url = reqUrl
Expand All @@ -34,5 +40,3 @@ foojay.fetchtJdkList= function (distribution, version)
end

return foojay


0 comments on commit d99e8d8

Please sign in to comment.