From 1cc578bf16a9a97806310e16ec5154302863e8c6 Mon Sep 17 00:00:00 2001 From: Yuri Norwood <106889957+norwd@users.noreply.github.com> Date: Mon, 7 Nov 2022 10:59:29 +1300 Subject: [PATCH] Add install directory to path Signed-off-by: Yuri Norwood <106889957+norwd@users.noreply.github.com> --- index.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index ec80c66..52477ef 100644 --- a/index.js +++ b/index.js @@ -13,10 +13,14 @@ async function downloadRelease(octokit, os, org, repo, release, token) { const postfix = `_${os}_amd64.${os === "windows" ? "zip" : "tar.gz"}`; const pathsep = os === "windows" ? "\\" : "/"; const tempdir = os === "windows" ? process.env.TEMP : "/tmp"; - const binpath = os === "windows" ? "C:\\Program Files" : "/usr/local/bin"; + const binpath = os === "windows" ? "C:\\Program Files\\GoTestTools" : "/usr/local/bin"; const extract = os === "windows" ? "tar -xvf" : "tar -xvzf"; const archive = `${tempdir}${pathsep}gotestfmt${postfix}`; - + + if (os === windows) { + execSync(`"${binpath}" >> $env:GITHUB_PATH`); + } + console.debug("postfix: " + postfix); console.debug("pathsep: " + pathsep); console.debug("tempdir: " + tempdir);