diff --git a/dist/cleanup/index.js b/dist/cleanup/index.js index 3b626d6..c90128b 100644 --- a/dist/cleanup/index.js +++ b/dist/cleanup/index.js @@ -88363,11 +88363,8 @@ function getVersionFromFileContent(content, distributionName, versionFile) { javaVersionRegExp = /^(java\s+)(?:\S*-)?v?(?(\d+)(\.\d+)?(\.\d+)?(\+\d+)?(-ea(\.\d+)?)?)$/m; } - else if (versionFileName == '.java-version') { - javaVersionRegExp = /(?(?<=(^|\s|-))(\d+\S*))(\s|$)/; - } else { - throw new Error('Invalid version file'); + javaVersionRegExp = /(?(?<=(^|\s|-))(\d+\S*))(\s|$)/; } const fileContent = ((_b = (_a = content.match(javaVersionRegExp)) === null || _a === void 0 ? void 0 : _a.groups) === null || _b === void 0 ? void 0 : _b.version) ? (_d = (_c = content.match(javaVersionRegExp)) === null || _c === void 0 ? void 0 : _c.groups) === null || _d === void 0 ? void 0 : _d.version diff --git a/dist/setup/index.js b/dist/setup/index.js index 5c9f40a..1302348 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -125737,11 +125737,8 @@ function getVersionFromFileContent(content, distributionName, versionFile) { javaVersionRegExp = /^(java\s+)(?:\S*-)?v?(?(\d+)(\.\d+)?(\.\d+)?(\+\d+)?(-ea(\.\d+)?)?)$/m; } - else if (versionFileName == '.java-version') { - javaVersionRegExp = /(?(?<=(^|\s|-))(\d+\S*))(\s|$)/; - } else { - throw new Error('Invalid version file'); + javaVersionRegExp = /(?(?<=(^|\s|-))(\d+\S*))(\s|$)/; } const fileContent = ((_b = (_a = content.match(javaVersionRegExp)) === null || _a === void 0 ? void 0 : _a.groups) === null || _b === void 0 ? void 0 : _b.version) ? (_d = (_c = content.match(javaVersionRegExp)) === null || _c === void 0 ? void 0 : _c.groups) === null || _d === void 0 ? void 0 : _d.version diff --git a/src/util.ts b/src/util.ts index 7cdf735..034fc83 100644 --- a/src/util.ts +++ b/src/util.ts @@ -128,10 +128,8 @@ export function getVersionFromFileContent( if (versionFileName == '.tool-versions') { javaVersionRegExp = /^(java\s+)(?:\S*-)?v?(?(\d+)(\.\d+)?(\.\d+)?(\+\d+)?(-ea(\.\d+)?)?)$/m; - } else if (versionFileName == '.java-version') { - javaVersionRegExp = /(?(?<=(^|\s|-))(\d+\S*))(\s|$)/; } else { - throw new Error('Invalid version file'); + javaVersionRegExp = /(?(?<=(^|\s|-))(\d+\S*))(\s|$)/; } const fileContent = content.match(javaVersionRegExp)?.groups?.version