Skip to content

Commit c9b5862

Browse files
authored
Fix architecture type usage in URL formatting (#47)
The Foojay API now lists Windows amd64 as x64
1 parent b9ebfd8 commit c9b5862

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/foojay.lua

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,25 @@ local URL =
99
foojay.fetchtJdkList= function (distribution, version)
1010

1111
local os = RUNTIME.osType
12+
local arch = RUNTIME.archType
1213
if os == "darwin" then
1314
os = "macos"
1415
end
1516

1617
local archive_type = "tar.gz"
1718
if os == "windows" then
1819
archive_type = "zip"
20+
if (arch == "amd64") then
21+
arch = "x64"
22+
end
1923
end
2024

2125
local lib_c_type = ""
2226
if os == "linux" then
2327
lib_c_type = "glibc"
2428
end
2529

26-
local reqUrl = URL:format(version, distribution, RUNTIME.archType, archive_type, os, lib_c_type)
30+
local reqUrl = URL:format(version, distribution, arch, archive_type, os, lib_c_type)
2731

2832
local resp, err = http.get({
2933
url = reqUrl

0 commit comments

Comments
 (0)