From ac4055ad14bbcb2c0d2719754623f291f68f20c8 Mon Sep 17 00:00:00 2001 From: Yuri Norwood <106889957+norwd@users.noreply.github.com> Date: Mon, 7 Nov 2022 12:27:28 +1300 Subject: [PATCH] Attempt to create custom binpath in windows Signed-off-by: Yuri Norwood <106889957+norwd@users.noreply.github.com> --- index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index cfebbb5..0e4e324 100644 --- a/index.js +++ b/index.js @@ -13,10 +13,15 @@ async function downloadRelease(octokit, os, org, repo, release, token) { // Determine environment specific details, paths etc... const postfix = `_${os}_amd64.${os === "windows" ? "zip" : "tar.gz"}`; const tempdir = os === "windows" ? process.env.TEMP + "\\" : "/tmp/"; - const binpath = os === "windows" ? process.env.USERPROFILE + "\\bin" : "/usr/local/bin"; + const binpath = os === "windows" ? "C:\\Program Files\\GoTestTools\\bin\\" : "/usr/local/bin/"; const extract = os === "windows" ? "tar -xvf" : "tar -xvzf"; const archive = `${tempdir}gotestfmt${postfix}`; + if (os === "windows") { + fs.mkdirpSync(binpath) + execSync(`echo "${binpath}" >> ${process.env.GITHUB_PATH}`) + } + // 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