Correctly avoid assignment to const variable

Signed-off-by: Yuri Norwood <106889957+norwd@users.noreply.github.com>
This commit is contained in:
Yuri Norwood 2022-11-07 09:38:48 +13:00 committed by GitHub
parent 74659dabed
commit 026aad37c7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -10,8 +10,7 @@ async function downloadRelease(octokit, os, org, repo, release, token) {
release_id: release.id,
})
extension = os === "windows" ? "zip" : "tar.gz";
postfix = `_${os}_amd64.${extension}`;
postfix = `_${os}_amd64.${os === "windows" ? "zip" : "tar.gz"}`;
for (let asset of releaseAssets.data) {
console.log("Examining release asset " + asset.name + " at " + asset.browser_download_url + " ...")
@ -77,14 +76,16 @@ async function downloadGofmt(octokit, version, versionPrefix, os, org, repo, tok
}
async function determineOS() {
const os = execSync("uname").toString().trim().toLowerCase()
const uname = execSync("uname")
os = uname.toString().trim().toLowerCase()
if (os.indexOf("msys_nt") === 0)
{
os = "windows";
}
console.log(`Running on OS '${os}'`)
return os
}