mirror of
https://github.com/actions/setup-java.git
synced 2025-04-21 02:16:45 +00:00
remove extra logic
This commit is contained in:
parent
005617c0f8
commit
3ad305894c
2 changed files with 2 additions and 36 deletions
17
dist/setup/index.js
vendored
17
dist/setup/index.js
vendored
|
@ -14008,8 +14008,7 @@ class ZuluDistribution extends base_installer_1.JavaBase {
|
|||
extractedJavaPath = yield util_1.extractJdkFile(javaArchivePath, extension);
|
||||
const archiveName = fs_1.default.readdirSync(extractedJavaPath)[0];
|
||||
const archivePath = path_1.default.join(extractedJavaPath, archiveName);
|
||||
const jdkPath = this.findJDKInstallationSubfolder(archivePath);
|
||||
const javaPath = yield tc.cacheDir(jdkPath, this.toolcacheFolderName, this.getToolcacheVersionName(javaRelease.version), this.architecture);
|
||||
const javaPath = yield tc.cacheDir(archivePath, this.toolcacheFolderName, this.getToolcacheVersionName(javaRelease.version), this.architecture);
|
||||
return { version: javaRelease.version, path: javaPath };
|
||||
});
|
||||
}
|
||||
|
@ -14082,20 +14081,6 @@ class ZuluDistribution extends base_installer_1.JavaBase {
|
|||
}
|
||||
return mainVersion;
|
||||
}
|
||||
findJDKInstallationSubfolder(archiveFolder) {
|
||||
if (process.platform != 'darwin') {
|
||||
return archiveFolder;
|
||||
}
|
||||
// Zulu archive on macOS contains a set of symlinks and zulu-<major_version>.jdk subfolder
|
||||
const jdkFolders = fs_1.default
|
||||
.readdirSync(archiveFolder, { withFileTypes: true })
|
||||
.filter(item => item.isDirectory() && !item.isSymbolicLink())
|
||||
.filter(item => /^zulu-\d+\.\w+$/.test(item.name));
|
||||
if (jdkFolders.length === 0) {
|
||||
return archiveFolder;
|
||||
}
|
||||
return path_1.default.join(archiveFolder, jdkFolders[0].name);
|
||||
}
|
||||
}
|
||||
exports.ZuluDistribution = ZuluDistribution;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue