From 580790fbabf93943c9fc077bc4ac90338a01bca1 Mon Sep 17 00:00:00 2001 From: Yuri Norwood <106889957+norwd@users.noreply.github.com> Date: Mon, 7 Nov 2022 09:50:30 +1300 Subject: [PATCH] Use environment defined temp path Signed-off-by: Yuri Norwood <106889957+norwd@users.noreply.github.com> --- index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 8da084d..390ae19 100644 --- a/index.js +++ b/index.js @@ -11,6 +11,7 @@ async function downloadRelease(octokit, os, org, repo, release, token) { }) const postfix = `_${os}_amd64.${os === "windows" ? "zip" : "tar.gz"}`; + const tempdir = os === "windows" ? process.env.TEMP : "/tmp"; for (let asset of releaseAssets.data) { @@ -19,9 +20,9 @@ async function downloadRelease(octokit, os, org, repo, release, token) { console.log("Found binary named " + asset.name + " at " + asset.browser_download_url + " , attempting download...") if (token) { - execSync(`curl -L -o /tmp/gotestfmt${postfix} -H "Authorization: Bearer ${token}" ${asset.browser_download_url}`) + execSync(`curl -L -o ${tempdir}/gotestfmt${postfix} -H "Authorization: Bearer ${token}" ${asset.browser_download_url}`) } else { - execSync(`curl -L -o /tmp/gotestfmt${postfix} {asset.browser_download_url}`) + execSync(`curl -L -o ${tempdir}/gotestfmt${postfix} {asset.browser_download_url}`) } console.log("Creating /usr/local/lib/gotestfmt directory...")