mirror of
https://github.com/actions/setup-java.git
synced 2025-04-20 01:46:46 +00:00
Fix Windows archives extraction issue
This commit is contained in:
parent
40b9536ce5
commit
0b70bb777b
15 changed files with 4450 additions and 4400 deletions
|
@ -5,7 +5,8 @@ import path from 'path';
|
|||
import {
|
||||
extractJdkFile,
|
||||
getDownloadArchiveExtension,
|
||||
convertVersionToSemver
|
||||
convertVersionToSemver,
|
||||
renameWinArchive
|
||||
} from '../../util';
|
||||
import {JavaBase} from '../base-installer';
|
||||
import {
|
||||
|
@ -29,14 +30,14 @@ export class CorrettoDistribution extends JavaBase {
|
|||
core.info(
|
||||
`Downloading Java ${javaRelease.version} (${this.distribution}) from ${javaRelease.url} ...`
|
||||
);
|
||||
const javaArchivePath = await tc.downloadTool(javaRelease.url);
|
||||
let javaArchivePath = await tc.downloadTool(javaRelease.url);
|
||||
|
||||
core.info(`Extracting Java archive...`);
|
||||
|
||||
const extractedJavaPath = await extractJdkFile(
|
||||
javaArchivePath,
|
||||
getDownloadArchiveExtension()
|
||||
);
|
||||
const extension = getDownloadArchiveExtension();
|
||||
if (process.platform === 'win32') {
|
||||
javaArchivePath = renameWinArchive(javaArchivePath);
|
||||
}
|
||||
const extractedJavaPath = await extractJdkFile(javaArchivePath, extension);
|
||||
|
||||
const archiveName = fs.readdirSync(extractedJavaPath)[0];
|
||||
const archivePath = path.join(extractedJavaPath, archiveName);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue