diff --git a/lib/installer.js b/lib/installer.js index cc2cb5b..91f9ed1 100644 --- a/lib/installer.js +++ b/lib/installer.js @@ -131,7 +131,7 @@ function unzipJavaDownload(repoRoot, fileEnding, destinationFolder) { const stats = fs.statSync(jdkFile); if (stats.isFile()) { yield extractFiles(jdkFile, fileEnding, destinationFolder); - const jdkDirectory = fs.readdirSync(destinationFolder)[0]; + const jdkDirectory = path.join(destinationFolder, fs.readdirSync(destinationFolder)[0]); yield unpackJars(jdkDirectory, path.join(jdkDirectory, 'bin')); return jdkDirectory; } diff --git a/src/installer.ts b/src/installer.ts index 03572bb..b5d4fe3 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -128,7 +128,10 @@ async function unzipJavaDownload( const stats = fs.statSync(jdkFile); if (stats.isFile()) { await extractFiles(jdkFile, fileEnding, destinationFolder); - const jdkDirectory = fs.readdirSync(destinationFolder)[0]; + const jdkDirectory = path.join( + destinationFolder, + fs.readdirSync(destinationFolder)[0] + ); await unpackJars(jdkDirectory, path.join(jdkDirectory, 'bin')); return jdkDirectory; } else {