From 84817402a9d72abca40b2933a57cd0196bbbc9a1 Mon Sep 17 00:00:00 2001 From: Danny McCormick Date: Wed, 10 Jul 2019 15:26:18 -0400 Subject: [PATCH] Full path --- lib/installer.js | 2 +- src/installer.ts | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) 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 {