From 1ca68d2589d3d56ecd3881dfe6ffa87eeda9c939 Mon Sep 17 00:00:00 2001 From: Jefferson Date: Fri, 7 Jun 2024 10:27:40 -0400 Subject: [PATCH] fix: Add absolute path for bin fix: Add absolute path for bin --- dist/setup/293248747edf5d37944a.js | 1 + dist/setup/index.js | 5 +++-- src/lib/install.js | 5 +++-- 3 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 dist/setup/293248747edf5d37944a.js diff --git a/dist/setup/293248747edf5d37944a.js b/dist/setup/293248747edf5d37944a.js new file mode 100644 index 0000000..1b9ade3 --- /dev/null +++ b/dist/setup/293248747edf5d37944a.js @@ -0,0 +1 @@ +module.exports = eval("require")("."); diff --git a/dist/setup/index.js b/dist/setup/index.js index 40c4af3..ca1b6b7 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -32721,6 +32721,7 @@ async function setupNsolid({ nodeVersion, nsolidVersion, platform, arch }) { platform, arch, }); + let toolPath = await downloadNsolid(metadata); if (metadata.platform === "win32") { toolPath = external_path_.join(core.toWin32Path(`${toolPath}/`)); @@ -32753,6 +32754,7 @@ async function setupNsolid({ nodeVersion, nsolidVersion, platform, arch }) { async function downloadNsolid(metadata) { let downloadPath = ""; + const extractPath = process.env.RUNNER_TEMP || process.env.RUNNER_WORKSPACE || process.cwd(); const fileName = `nsolid-v${metadata.nsolidVersion}-${metadata.nodeVersion}-${metadata.platform}-${metadata.arch}`; // If the platform is win32, we need to extract the tarball and move the files to a different location. @@ -32765,9 +32767,8 @@ async function downloadNsolid(metadata) { ]); return toolPath; } - downloadPath = await tool_cache.downloadTool(metadata.url); - const toolPath = await tool_cache.extractTar(downloadPath, fileName, ["xz", "--strip", "1"]); + const toolPath = await tool_cache.extractTar(downloadPath, `${extractPath}/${fileName}`, ["xz", "--strip", "1"]); return toolPath; } diff --git a/src/lib/install.js b/src/lib/install.js index 7292c3a..549c0c2 100644 --- a/src/lib/install.js +++ b/src/lib/install.js @@ -11,6 +11,7 @@ export async function setupNsolid({ nodeVersion, nsolidVersion, platform, arch } platform, arch, }); + let toolPath = await downloadNsolid(metadata); if (metadata.platform === "win32") { toolPath = path.join(core.toWin32Path(`${toolPath}/`)); @@ -43,6 +44,7 @@ export async function setupNsolid({ nodeVersion, nsolidVersion, platform, arch } async function downloadNsolid(metadata) { let downloadPath = ""; + const extractPath = process.env.RUNNER_TEMP || process.env.RUNNER_WORKSPACE || process.cwd(); const fileName = `nsolid-v${metadata.nsolidVersion}-${metadata.nodeVersion}-${metadata.platform}-${metadata.arch}`; // If the platform is win32, we need to extract the tarball and move the files to a different location. @@ -55,8 +57,7 @@ async function downloadNsolid(metadata) { ]); return toolPath; } - downloadPath = await tc.downloadTool(metadata.url); - const toolPath = await tc.extractTar(downloadPath, fileName, ["xz", "--strip", "1"]); + const toolPath = await tc.extractTar(downloadPath, `${extractPath}/${fileName}`, ["xz", "--strip", "1"]); return toolPath; }