Extract right directory

This commit is contained in:
Danny McCormick 2019-07-10 15:16:09 -04:00
parent 71c35fe7fa
commit 05dd7fbe75
2 changed files with 8 additions and 4 deletions

View File

@ -49,8 +49,8 @@ function getJava(versionSpec, arch, jdkFile) {
core.debug('Retrieving Jdk from local path');
const compressedFileExtension = getFileEnding(jdkFile);
let tempDir = path.join(tempDirectory, 'temp_' + Math.floor(Math.random() * 2000000000));
yield unzipJavaDownload(jdkFile, compressedFileExtension, tempDir);
toolPath = yield tc.cacheDir(tempDir, 'Java', versionSpec, arch);
const jdkDir = yield unzipJavaDownload(jdkFile, compressedFileExtension, tempDir);
toolPath = yield tc.cacheDir(jdkDir, 'Java', versionSpec, arch);
}
let extendedJavaHome = 'JAVA_HOME_' + versionSpec + '_' + arch;
core.exportVariable('JAVA_HOME', toolPath);

View File

@ -40,8 +40,12 @@ export async function getJava(
tempDirectory,
'temp_' + Math.floor(Math.random() * 2000000000)
);
await unzipJavaDownload(jdkFile, compressedFileExtension, tempDir);
toolPath = await tc.cacheDir(tempDir, 'Java', versionSpec, arch);
const jdkDir = await unzipJavaDownload(
jdkFile,
compressedFileExtension,
tempDir
);
toolPath = await tc.cacheDir(jdkDir, 'Java', versionSpec, arch);
}
let extendedJavaHome = 'JAVA_HOME_' + versionSpec + '_' + arch;