mirror of
https://github.com/actions/setup-java.git
synced 2025-04-19 17:36:45 +00:00
Update installer.ts
This commit is contained in:
parent
57c14a4598
commit
b5490195d1
1 changed files with 7 additions and 3 deletions
|
@ -164,11 +164,15 @@ export class ZuluDistribution extends JavaBase {
|
||||||
}
|
}
|
||||||
|
|
||||||
private findJDKInstallationSubfolder(archiveFolder: string) {
|
private findJDKInstallationSubfolder(archiveFolder: string) {
|
||||||
// Zulu archive contains a bunch of symlinks and zulu-<major_version>.jdk subfolder
|
if (process.platform != 'darwin') {
|
||||||
|
return archiveFolder;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Zulu archive on macOS contains a set of symlinks and zulu-<major_version>.jdk subfolder
|
||||||
const jdkFolders = fs
|
const jdkFolders = fs
|
||||||
.readdirSync(archiveFolder, { withFileTypes: true })
|
.readdirSync(archiveFolder, { withFileTypes: true })
|
||||||
.filter(item => !item.isSymbolicLink())
|
.filter(item => item.isDirectory() && !item.isSymbolicLink() )
|
||||||
.filter(item => item.name.startsWith('zulu-') && item.name.endsWith('.jdk'));
|
.filter(item => /^zulu-\d+\.\w+$/.test(item.name));
|
||||||
if (jdkFolders.length === 0) {
|
if (jdkFolders.length === 0) {
|
||||||
return archiveFolder;
|
return archiveFolder;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue