File tree Expand file tree Collapse file tree 2 files changed +12
-9
lines changed
Expand file tree Collapse file tree 2 files changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -7,17 +7,18 @@ local distribution_version_parser = require("distribution_version")
77function PLUGIN :Available (ctx )
88 local query = ctx .args [1 ] or " open"
99 local jdks = {}
10+ local distribution = nil
1011
1112 if query == " all" then
12- for _ , distribution in ipairs (distribution_version_parser .distributions ) do
13- local tempJdks = foojay .fetchtJdkList (distribution .name , " " )
13+ for _ , dist in ipairs (distribution_version_parser .distributions ) do
14+ local tempJdks = foojay .fetchtJdkList (dist .name , " " )
1415 for _ , jdk in ipairs (tempJdks ) do
15- jdk .short = distribution .short_name
16+ jdk .short = dist .short_name
1617 table.insert (jdks , jdk )
1718 end
1819 end
1920 else
20- local distribution = distribution_version_parser .parse_distribution (query )
21+ distribution = distribution_version_parser .parse_distribution (query )
2122 if not distribution then
2223 error (" Unsupported distribution: " .. query )
2324 end
@@ -41,10 +42,6 @@ function PLUGIN:Available(ctx)
4142 elseif query == " open" then
4243 v = v .. fx_suffix
4344 else
44- local distribution = distribution_version_parser .parse_distribution (query )
45- if not distribution then
46- error (" Unsupported distribution: " .. query )
47- end
4845 v = v .. fx_suffix .. " -" .. distribution .short_name
4946 end
5047
Original file line number Diff line number Diff line change @@ -45,7 +45,13 @@ function PLUGIN:PreInstall(ctx)
4545 if jdk .javafx_bundled == true then
4646 fx_suffix = " -fx"
4747 end
48- local finalV = distribution_version .distribution .short_name == " open" and jdk .java_version .. fx_suffix or jdk .java_version .. fx_suffix .. " -" .. distribution_version .distribution .short_name
48+
49+ local finalV
50+ if distribution_version .distribution .short_name == " open" then
51+ finalV = jdk .java_version .. fx_suffix
52+ else
53+ finalV = jdk .java_version .. fx_suffix .. " -" .. distribution_version .distribution .short_name
54+ end
4955 return {
5056 -- [info.checksum_type] = checksum,
5157 url = info .direct_download_uri ,
You can’t perform that action at this time.
0 commit comments