From da3b74f054a241aa33d7be825af5b288ed162fe7 Mon Sep 17 00:00:00 2001 From: Dwi Siswanto Date: Sun, 12 Jan 2025 09:43:18 +0700 Subject: [PATCH] fix: unable to locate executable file err cuz the binary is wraps in directory Signed-off-by: Dwi Siswanto --- dist/index.js | 7 ++++--- src/index.ts | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/dist/index.js b/dist/index.js index 87814db..07246a4 100644 --- a/dist/index.js +++ b/dist/index.js @@ -94,7 +94,7 @@ function get_slim() { const_1.core.notice(`slim ${VER} found in cache`); } else { - slimPath = const_1.path.join(process.env.GITHUB_WORKSPACE, '../', 'slim'); + const parentWorkspace = const_1.path.join(process.env.GITHUB_WORKSPACE, '../'); let srcPath; try { const_1.core.debug(`Downloading slim ${VER} for ${KERNEL}/${MACHINE}...`); @@ -107,15 +107,16 @@ function get_slim() { try { const_1.core.debug(`Extracting slim ${VER}...`); if (EXT === 'zip') { - extractedPath = yield const_1.tc.extractZip(srcPath, slimPath); + extractedPath = yield const_1.tc.extractZip(srcPath, parentWorkspace); } else { // tar.gz - extractedPath = yield const_1.tc.extractTar(srcPath, slimPath); + extractedPath = yield const_1.tc.extractTar(srcPath, parentWorkspace); } } catch (error) { throw new Error(`Could not extract slim: ${error.message}`); } + extractedPath = const_1.path.join(extractedPath, DIST); const_1.core.debug('Caching slim...'); slimPath = yield const_1.tc.cacheDir(extractedPath, 'slim', VER, MACHINE); } diff --git a/src/index.ts b/src/index.ts index a7b44f5..8718b36 100644 --- a/src/index.ts +++ b/src/index.ts @@ -88,7 +88,7 @@ async function get_slim() { if (slimPath) { core.notice(`slim ${VER} found in cache`) } else { - slimPath = path.join(process.env.GITHUB_WORKSPACE, '../', 'slim') + const parentWorkspace = path.join(process.env.GITHUB_WORKSPACE, '../') let srcPath try { @@ -102,13 +102,14 @@ async function get_slim() { try { core.debug(`Extracting slim ${VER}...`) if (EXT === 'zip') { - extractedPath = await tc.extractZip(srcPath, slimPath) + extractedPath = await tc.extractZip(srcPath, parentWorkspace) } else { // tar.gz - extractedPath = await tc.extractTar(srcPath, slimPath) + extractedPath = await tc.extractTar(srcPath, parentWorkspace) } } catch (error) { throw new Error(`Could not extract slim: ${error.message}`) } + extractedPath = path.join(extractedPath, DIST) core.debug('Caching slim...') slimPath = await tc.cacheDir(extractedPath, 'slim', VER, MACHINE)