From 889a9543120af006ed0578fd377be241a466c71f Mon Sep 17 00:00:00 2001 From: Yuri Norwood <106889957+norwd@users.noreply.github.com> Date: Mon, 7 Nov 2022 12:11:06 +1300 Subject: [PATCH] Only manually add the binpath on windows Signed-off-by: Yuri Norwood <106889957+norwd@users.noreply.github.com> --- index.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/index.js b/index.js index 6ad4989..7132507 100644 --- a/index.js +++ b/index.js @@ -17,6 +17,12 @@ async function downloadRelease(octokit, os, org, repo, release, token) { const extract = os === "windows" ? "tar -xvf" : "tar -xvzf"; const archive = `${tempdir}gotestfmt${postfix}`; + if (os === "windows") { + // Ensure the that the install target exists + fs.mkdirSync(binpath, { recursive: true }) + core.addPath(binpath); + } + // Search through the latest release assets for an install canidate for (let asset of releaseAssets.data) { // Check if the asset name matches the determined postfix @@ -32,11 +38,6 @@ async function downloadRelease(octokit, os, org, repo, release, token) { execSync(`curl -L -o ${archive} ${asset.browser_download_url}`) } - // Ensure the that the install target exists - console.log("Preparing install target...") - fs.mkdirSync(binpath, { recursive: true }) - core.addPath(binpath); - // Extract the archive into the install target console.log("Unpacking archive file...") execSync(`cd "${binpath}" && ${extract} ${archive}`)