Use more meaningful name for binpath

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

View file

@ -13,7 +13,7 @@ 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 libpath = os === "windows" ? process.env.USERPROFILE + "\\bin" : "/usr/local/bin";
const binpath = os === "windows" ? process.env.USERPROFILE + "\\bin" : "/usr/local/bin";
const extract = os === "windows" ? "tar -xvf " : "tar -xvzf";
const archive = `${tempdir}${pathsep}gotestfmt${postfix}`;
@ -30,13 +30,12 @@ async function downloadRelease(octokit, os, org, repo, release, token) {
}
console.log("Unpacking archive file...")
execSync(`cd ${libpath} && ${extract} ${archive}`)
execSync(`cd ${binpath} && ${extract} ${archive}`)
console.log("Removing asset archive...")
fs.unlinkSync(`${archive}`)
console.log("Successfully set up gotestfmt.")
return
}
}