5
0
mirror of https://gitea.com/actions/setup-java.git synced 2025-10-26 07:16:35 +00:00

Dont fail if jdkFile not set until checking cache

This commit is contained in:
Danny McCormick
2019-07-15 11:26:32 -04:00
parent 609f104c5b
commit 012e07621e
5 changed files with 11 additions and 3 deletions

View File

@@ -46,6 +46,9 @@ function getJava(version, arch, jdkFile) {
core.debug(`Tool found in cache ${toolPath}`);
}
else {
if (!jdkFile) {
throw new Error(`Failed to find Java ${version} in the cache. Please specify a valid jdk file to install from instead.`);
}
core.debug('Retrieving Jdk from local path');
const compressedFileExtension = getFileEnding(jdkFile);
let tempDir = path.join(tempDirectory, 'temp_' + Math.floor(Math.random() * 2000000000));