From 262468e92f905d96c8523a3dd27f1c0fe0a713d1 Mon Sep 17 00:00:00 2001 From: Bryan MacFarlane Date: Thu, 26 Mar 2020 13:46:15 -0400 Subject: [PATCH] only needed to do once --- dist/index.js | 9 ++------- src/main.ts | 9 ++------- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/dist/index.js b/dist/index.js index 2414b9b..44cd9ec 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1294,8 +1294,6 @@ function run() { // since getting unstable versions should be explicit let stable = (core.getInput('stable') || 'true').toUpperCase() === 'TRUE'; console.log(`Setup go ${stable ? 'stable' : ''} version spec ${versionSpec}`); - // if there's a globally install go and bin path, prefer that - let addedBin = addBinToPath(); if (versionSpec) { let installDir = tc.find('go', versionSpec); if (!installDir) { @@ -1307,11 +1305,8 @@ function run() { core.exportVariable('GOROOT', installDir); core.addPath(path.join(installDir, 'bin')); console.log('Added go to the path'); - // if the global installed bin wasn't added, - // we can add the bin just installed - if (!addedBin) { - addBinToPath(); - } + let added = addBinToPath(); + core.debug(`add bin ${added}`); } else { throw new Error(`Could not find a version that satisfied version spec: ${versionSpec}`); diff --git a/src/main.ts b/src/main.ts index 887d72f..46f9019 100644 --- a/src/main.ts +++ b/src/main.ts @@ -22,8 +22,6 @@ export async function run() { `Setup go ${stable ? 'stable' : ''} version spec ${versionSpec}` ); - // if there's a globally install go and bin path, prefer that - let addedBin = addBinToPath(); if (versionSpec) { let installDir: string | undefined = tc.find('go', versionSpec); @@ -40,11 +38,8 @@ export async function run() { core.addPath(path.join(installDir, 'bin')); console.log('Added go to the path'); - // if the global installed bin wasn't added, - // we can add the bin just installed - if (!addedBin) { - addBinToPath(); - } + let added = addBinToPath(); + core.debug(`add bin ${added}`); } else { throw new Error( `Could not find a version that satisfied version spec: ${versionSpec}`