Skip to content

Commit

Permalink
Update util.js
Browse files Browse the repository at this point in the history
  • Loading branch information
willnode committed Feb 15, 2024
1 parent d7e3421 commit f1262d2
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,14 +175,17 @@ export const getRubyVersion = (/** @type {string} */ status) => {
if (/^ruby-/.test(status)) {
status = status.substring(5);
}
if (/^\d+(\.\d+){0,2}$/.test(status)) {
if (/^\d+(\.\d+)?$/.test(status)) {
var m = rubyVersionsList.find(x => {
return x.startsWith(status);
});
if (m) {
return m;
}
}
if (/^\d+\.\d+\.\d+$/.test(status)) {
return status;
}
switch (status) {
case 'lts':
case 'security':
Expand All @@ -207,19 +210,14 @@ export const getJavaVersion = (/** @type {string} */ status) => {
if (!status) {
return expand(stable);
}
if (/^\d+(\.\d+)?$/.test(status)) {
if (/^\d+(\.\d+){0,2}$/.test(status)) {
var m = javaVersionsList.find(x => {
return x.startsWith(status);
});
if (m) {
return expand(m);
} else {
return expand(status + ":latest");
}
}
if (/^\d+\.\d+\.\d+$/.test(status)) {
return expand(status);
}
switch (status) {
case 'lts':
case 'security':
Expand Down

0 comments on commit f1262d2

Please sign in to comment.