diff --git a/dist/index.js b/dist/index.js index 82f2846..abea063 100644 --- a/dist/index.js +++ b/dist/index.js @@ -13013,15 +13013,22 @@ function getNode(versionSpec, stable, token) { // // Extract // + console.log(`Extracting ${downloadPath}`); + if (!fs.existsSync(downloadPath)) { + console.log('File not downloaded correctly'); + } let extPath; if (osPlat == 'win32') { let _7zPath = path.join(__dirname, '..', 'externals', '7zr.exe'); extPath = yield tc.extract7z(downloadPath, undefined, _7zPath); + console.log(`contents of ${extPath}`); + console.log(extPath); // 7z extracts to folder matching file name let nestedPath = path.join(extPath, path.basename(info.fileName, '.7z')); - if (fs.statSync(nestedPath) && fs.statSync(nestedPath).isDirectory()) { + if (fs.existsSync(nestedPath)) { extPath = nestedPath; } + console.log(`using ${extPath}`); } else { extPath = yield tc.extractTar(downloadPath, undefined, [ diff --git a/src/installer.ts b/src/installer.ts index 3952b87..3a1c8ad 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -74,11 +74,11 @@ export async function getNode( // // Extract // - console.log(`Extracting ${downloadPath}`) + console.log(`Extracting ${downloadPath}`); if (!fs.existsSync(downloadPath)) { - throw new Error('File not downloaded correctly'); + console.log('File not downloaded correctly'); } - + let extPath: string; if (osPlat == 'win32') { let _7zPath = path.join(__dirname, '..', 'externals', '7zr.exe'); @@ -90,7 +90,7 @@ export async function getNode( if (fs.existsSync(nestedPath)) { extPath = nestedPath; } - + console.log(`using ${extPath}`); } else { extPath = await tc.extractTar(downloadPath, undefined, [