diff --git a/dist/setup/index.js b/dist/setup/index.js index 5b86ad15..28da6b31 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -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-.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; diff --git a/src/distributions/zulu/installer.ts b/src/distributions/zulu/installer.ts index 87284927..7cb32704 100644 --- a/src/distributions/zulu/installer.ts +++ b/src/distributions/zulu/installer.ts @@ -72,10 +72,8 @@ export class ZuluDistribution extends JavaBase { const archiveName = fs.readdirSync(extractedJavaPath)[0]; const archivePath = path.join(extractedJavaPath, archiveName); - const jdkPath = this.findJDKInstallationSubfolder(archivePath); - const javaPath = await tc.cacheDir( - jdkPath, + archivePath, this.toolcacheFolderName, this.getToolcacheVersionName(javaRelease.version), this.architecture @@ -162,21 +160,4 @@ export class ZuluDistribution extends JavaBase { return mainVersion; } - - private findJDKInstallationSubfolder(archiveFolder: string) { - if (process.platform != 'darwin') { - return archiveFolder; - } - - // Zulu archive on macOS contains a set of symlinks and zulu-.jdk subfolder - const jdkFolders = fs - .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.join(archiveFolder, jdkFolders[0].name); - } }