Replace GOPATH with system dependent lib path

Signed-off-by: Yuri Norwood <106889957+norwd@users.noreply.github.com>
This commit is contained in:
Yuri Norwood 2022-11-07 10:26:17 +13:00 committed by GitHub
parent ae2240dd72
commit 645f9ad30b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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}`)