Skip to content

Commit da3b74f

Browse files
committed
fix: unable to locate executable file err
cuz the binary is wraps in directory Signed-off-by: Dwi Siswanto <git@dw1.io>
1 parent adc0faf commit da3b74f

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

dist/index.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ function get_slim() {
9494
const_1.core.notice(`slim ${VER} found in cache`);
9595
}
9696
else {
97-
slimPath = const_1.path.join(process.env.GITHUB_WORKSPACE, '../', 'slim');
97+
const parentWorkspace = const_1.path.join(process.env.GITHUB_WORKSPACE, '../');
9898
let srcPath;
9999
try {
100100
const_1.core.debug(`Downloading slim ${VER} for ${KERNEL}/${MACHINE}...`);
@@ -107,15 +107,16 @@ function get_slim() {
107107
try {
108108
const_1.core.debug(`Extracting slim ${VER}...`);
109109
if (EXT === 'zip') {
110-
extractedPath = yield const_1.tc.extractZip(srcPath, slimPath);
110+
extractedPath = yield const_1.tc.extractZip(srcPath, parentWorkspace);
111111
}
112112
else { // tar.gz
113-
extractedPath = yield const_1.tc.extractTar(srcPath, slimPath);
113+
extractedPath = yield const_1.tc.extractTar(srcPath, parentWorkspace);
114114
}
115115
}
116116
catch (error) {
117117
throw new Error(`Could not extract slim: ${error.message}`);
118118
}
119+
extractedPath = const_1.path.join(extractedPath, DIST);
119120
const_1.core.debug('Caching slim...');
120121
slimPath = yield const_1.tc.cacheDir(extractedPath, 'slim', VER, MACHINE);
121122
}

src/index.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ async function get_slim() {
8888
if (slimPath) {
8989
core.notice(`slim ${VER} found in cache`)
9090
} else {
91-
slimPath = path.join(process.env.GITHUB_WORKSPACE, '../', 'slim')
91+
const parentWorkspace = path.join(process.env.GITHUB_WORKSPACE, '../')
9292

9393
let srcPath
9494
try {
@@ -102,13 +102,14 @@ async function get_slim() {
102102
try {
103103
core.debug(`Extracting slim ${VER}...`)
104104
if (EXT === 'zip') {
105-
extractedPath = await tc.extractZip(srcPath, slimPath)
105+
extractedPath = await tc.extractZip(srcPath, parentWorkspace)
106106
} else { // tar.gz
107-
extractedPath = await tc.extractTar(srcPath, slimPath)
107+
extractedPath = await tc.extractTar(srcPath, parentWorkspace)
108108
}
109109
} catch (error) {
110110
throw new Error(`Could not extract slim: ${error.message}`)
111111
}
112+
extractedPath = path.join(extractedPath, DIST)
112113

113114
core.debug('Caching slim...')
114115
slimPath = await tc.cacheDir(extractedPath, 'slim', VER, MACHINE)

0 commit comments

Comments
 (0)