Skip to content

Commit

Permalink
Test backup code to linux/mac path not found during extraction
Browse files Browse the repository at this point in the history
  • Loading branch information
fantavlik committed Aug 25, 2023
1 parent 3648df2 commit 5a7915f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion out/notebooks/spl2/installer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -454,12 +454,18 @@ async function extractTgzWithProgress(
tar.extract(extractPath, {
map: (header) => {
if (header.name.endsWith(path.join('bin', 'java'))) {
binJavaPath = path.join(extractPath, header.name);
// binJavaPath = path.join(extractPath, header.name);
}
return header;
}
}),
);
if (!binJavaPath) {
const jdkDir = fs.readdirSync(extractPath).filter(fn => fn.startsWith('jdk')); // e.g. jdk17.0.7_7
if (jdkDir.length === 1) {
binJavaPath = path.join(extractPath, jdkDir[0], 'bin', 'java');
}
}
return Promise.resolve(binJavaPath);
}

Expand Down

0 comments on commit 5a7915f

Please sign in to comment.