Skip to content

Commit d99e8d8

Browse files
authored
fix: If the OS is Linux, add lib_c_type=glibc. (#14)
1 parent 0e50f86 commit d99e8d8

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

lib/foojay.lua

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ local json = require("json")
44
local foojay = {}
55

66
local URL =
7-
"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"
7+
"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"
88

99
foojay.fetchtJdkList= function (distribution, version)
1010

@@ -17,7 +17,13 @@ foojay.fetchtJdkList= function (distribution, version)
1717
if os == "windows" then
1818
archive_type = "zip"
1919
end
20-
local reqUrl = URL:format(version,distribution,RUNTIME.archType, archive_type, os)
20+
21+
local lib_c_type = ""
22+
if os == "linux" then
23+
lib_c_type = "glibc"
24+
end
25+
26+
local reqUrl = URL:format(version, distribution, RUNTIME.archType, archive_type, os, lib_c_type)
2127

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

3642
return foojay
37-
38-

0 commit comments

Comments
 (0)