mirror of
https://github.com/actions/setup-java.git
synced 2025-04-20 09:56:46 +00:00
remove unused import
This commit is contained in:
parent
53d9cbe60a
commit
e2c02857f1
2 changed files with 30 additions and 22 deletions
15
dist/setup/index.js
vendored
15
dist/setup/index.js
vendored
|
@ -105184,13 +105184,16 @@ function run() {
|
|||
toolchainIds = [];
|
||||
}
|
||||
if (!versions.length) {
|
||||
core.debug("JAVA_VERSION input is empty, looking for .java-version file");
|
||||
core.debug('JAVA_VERSION input is empty, looking for .java-version file');
|
||||
const versionFileName = '.java-version';
|
||||
const contents = fs_1.default.readFileSync(versionFileName).toString().trim();
|
||||
const contents = fs_1.default
|
||||
.readFileSync(versionFileName)
|
||||
.toString()
|
||||
.trim();
|
||||
const semverRegExp = /(\d+\.\d+\.\d+.*ea.*$|\d+\.\d+\.\d+\+\d*$|\d+\.\d+\.\d+|\d+\.\d+|\d+\-ea$|\d+$)/;
|
||||
let version = semverRegExp.test(contents) ? RegExp.$1 : "";
|
||||
let version = semverRegExp.test(contents) ? RegExp.$1 : '';
|
||||
let installed = false;
|
||||
while (!installed && version != "") {
|
||||
while (!installed && version != '') {
|
||||
try {
|
||||
core.debug(`Trying to install version ${version}`);
|
||||
yield installVersion(version);
|
||||
|
@ -105238,7 +105241,9 @@ function run() {
|
|||
});
|
||||
}
|
||||
function getHigherVersion(version) {
|
||||
return version.split("-")[0] === version ? version.substring(0, version.lastIndexOf(".")) : version.split("-")[0];
|
||||
return version.split('-')[0] === version
|
||||
? version.substring(0, version.lastIndexOf('.'))
|
||||
: version.split('-')[0];
|
||||
}
|
||||
}
|
||||
catch (error) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue