From a6a701e18eacb7221ed0454931e50e8ae0b95388 Mon Sep 17 00:00:00 2001 From: Bryan MacFarlane Date: Sun, 9 Feb 2020 22:39:44 -0500 Subject: [PATCH] better user output --- dist/index.js | 6 ++++++ src/installer.ts | 3 +++ src/main.ts | 9 +++++++++ 3 files changed, 18 insertions(+) diff --git a/dist/index.js b/dist/index.js index 8d015a9..82e9d4d 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1290,14 +1290,18 @@ function run() { // stable will be true unless false is the exact input // since getting unstable versions should be explicit let stable = Boolean(core.getInput('stable') || 'true'); + console.log(`Setup go ${stable ? 'stable' : ''} version spec ${versionSpec}`); if (versionSpec) { let installDir = tc.find('go', versionSpec); if (!installDir) { + console.log(`A version satisfying ${versionSpec} not found locally, attempting to download ...`); installDir = yield installer.downloadGo(versionSpec, stable); + console.log('installed'); } if (installDir) { core.exportVariable('GOROOT', installDir); core.addPath(path.join(installDir, 'bin')); + console.log('added to the path'); } else { throw new Error(`Could not find a version that satisfied version spec: ${versionSpec}`); @@ -4586,9 +4590,11 @@ function downloadGo(versionSpec, stable) { // download core_1.debug(`match ${match.version}`); let downloadUrl = `https://storage.googleapis.com/golang/${match.files[0].filename}`; + console.log(`Downloading from ${downloadUrl}`); let downloadPath = yield tc.downloadTool(downloadUrl); core_1.debug(`downloaded to ${downloadPath}`); // extract + console.log('Extracting ...'); let extPath = sys.getPlatform() == 'windows' ? yield tc.extractZip(downloadPath) : yield tc.extractTar(downloadPath); diff --git a/src/installer.ts b/src/installer.ts index 67173ca..7f734cd 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -18,10 +18,13 @@ export async function downloadGo( // download debug(`match ${match.version}`); let downloadUrl: string = `https://storage.googleapis.com/golang/${match.files[0].filename}`; + console.log(`Downloading from ${downloadUrl}`); + let downloadPath: string = await tc.downloadTool(downloadUrl); debug(`downloaded to ${downloadPath}`); // extract + console.log('Extracting ...'); let extPath: string = sys.getPlatform() == 'windows' ? await tc.extractZip(downloadPath) diff --git a/src/main.ts b/src/main.ts index 7f98b11..aa00a48 100644 --- a/src/main.ts +++ b/src/main.ts @@ -15,16 +15,25 @@ export async function run() { // since getting unstable versions should be explicit let stable = Boolean(core.getInput('stable') || 'true'); + console.log( + `Setup go ${stable ? 'stable' : ''} version spec ${versionSpec}` + ); + if (versionSpec) { let installDir: string | undefined = tc.find('go', versionSpec); if (!installDir) { + console.log( + `A version satisfying ${versionSpec} not found locally, attempting to download ...` + ); installDir = await installer.downloadGo(versionSpec, stable); + console.log('installed'); } if (installDir) { core.exportVariable('GOROOT', installDir); core.addPath(path.join(installDir, 'bin')); + console.log('added to the path'); } else { throw new Error( `Could not find a version that satisfied version spec: ${versionSpec}`