mirror of
https://github.com/GoTestTools/gotestfmt-action.git
synced 2026-02-08 00:37:27 +00:00
Replace GOPATH with system dependent lib path
Signed-off-by: Yuri Norwood <106889957+norwd@users.noreply.github.com>
This commit is contained in:
parent
ae2240dd72
commit
645f9ad30b
1 changed files with 3 additions and 3 deletions
6
index.js
6
index.js
|
|
@ -12,8 +12,8 @@ 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";
|
||||
const gopath = process.env.GOPATH + "/bin";
|
||||
const extract = "tar -xvzf";
|
||||
const libpath = os === "windows" ? process.env.USERPROFILE : "/usr/local";
|
||||
const extract = os === "windows" ? "tar -xvf " : "tar -xvzf";
|
||||
|
||||
for (let asset of releaseAssets.data) {
|
||||
|
||||
|
|
@ -28,7 +28,7 @@ async function downloadRelease(octokit, os, org, repo, release, token) {
|
|||
}
|
||||
|
||||
console.log("Unpacking archive file...")
|
||||
execSync(`cd ${gopath} && ${extract} ${tempdir}/gotestfmt${postfix}`)
|
||||
execSync(`cd ${libpath}/bin && ${extract} ${tempdir}/gotestfmt${postfix}`)
|
||||
|
||||
console.log("Removing asset archive...")
|
||||
fs.unlinkSync(`${tempdir}/gotestfmt${postfix}`)
|
||||
|
|
|
|||
Loading…
Reference in a new issue