Skip to content

Commit a6a701e

Browse files
better user output
1 parent 6b10398 commit a6a701e

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

dist/index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1290,14 +1290,18 @@ function run() {
12901290
// stable will be true unless false is the exact input
12911291
// since getting unstable versions should be explicit
12921292
let stable = Boolean(core.getInput('stable') || 'true');
1293+
console.log(`Setup go ${stable ? 'stable' : ''} version spec ${versionSpec}`);
12931294
if (versionSpec) {
12941295
let installDir = tc.find('go', versionSpec);
12951296
if (!installDir) {
1297+
console.log(`A version satisfying ${versionSpec} not found locally, attempting to download ...`);
12961298
installDir = yield installer.downloadGo(versionSpec, stable);
1299+
console.log('installed');
12971300
}
12981301
if (installDir) {
12991302
core.exportVariable('GOROOT', installDir);
13001303
core.addPath(path.join(installDir, 'bin'));
1304+
console.log('added to the path');
13011305
}
13021306
else {
13031307
throw new Error(`Could not find a version that satisfied version spec: ${versionSpec}`);
@@ -4586,9 +4590,11 @@ function downloadGo(versionSpec, stable) {
45864590
// download
45874591
core_1.debug(`match ${match.version}`);
45884592
let downloadUrl = `https://storage.googleapis.com/golang/${match.files[0].filename}`;
4593+
console.log(`Downloading from ${downloadUrl}`);
45894594
let downloadPath = yield tc.downloadTool(downloadUrl);
45904595
core_1.debug(`downloaded to ${downloadPath}`);
45914596
// extract
4597+
console.log('Extracting ...');
45924598
let extPath = sys.getPlatform() == 'windows'
45934599
? yield tc.extractZip(downloadPath)
45944600
: yield tc.extractTar(downloadPath);

src/installer.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,13 @@ export async function downloadGo(
1818
// download
1919
debug(`match ${match.version}`);
2020
let downloadUrl: string = `https://storage.googleapis.com/golang/${match.files[0].filename}`;
21+
console.log(`Downloading from ${downloadUrl}`);
22+
2123
let downloadPath: string = await tc.downloadTool(downloadUrl);
2224
debug(`downloaded to ${downloadPath}`);
2325

2426
// extract
27+
console.log('Extracting ...');
2528
let extPath: string =
2629
sys.getPlatform() == 'windows'
2730
? await tc.extractZip(downloadPath)

src/main.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,25 @@ export async function run() {
1515
// since getting unstable versions should be explicit
1616
let stable = Boolean(core.getInput('stable') || 'true');
1717

18+
console.log(
19+
`Setup go ${stable ? 'stable' : ''} version spec ${versionSpec}`
20+
);
21+
1822
if (versionSpec) {
1923
let installDir: string | undefined = tc.find('go', versionSpec);
2024

2125
if (!installDir) {
26+
console.log(
27+
`A version satisfying ${versionSpec} not found locally, attempting to download ...`
28+
);
2229
installDir = await installer.downloadGo(versionSpec, stable);
30+
console.log('installed');
2331
}
2432

2533
if (installDir) {
2634
core.exportVariable('GOROOT', installDir);
2735
core.addPath(path.join(installDir, 'bin'));
36+
console.log('added to the path');
2837
} else {
2938
throw new Error(
3039
`Could not find a version that satisfied version spec: ${versionSpec}`

0 commit comments

Comments
 (0)