mirror of
https://github.com/GoTestTools/gotestfmt-action.git
synced 2026-02-08 00:37:27 +00:00
Use environment defined temp path
Signed-off-by: Yuri Norwood <106889957+norwd@users.noreply.github.com>
This commit is contained in:
parent
f183840554
commit
580790fbab
1 changed files with 3 additions and 2 deletions
5
index.js
5
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...")
|
||||
|
|
|
|||
Loading…
Reference in a new issue