Skip to content

Commit e671865

Browse files
author
Dmitry Shibanov
committed
fixing path
1 parent c932c47 commit e671865

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

dist/index.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2528,10 +2528,7 @@ function run() {
25282528
let token = core.getInput('token');
25292529
let auth = !token || isGhes() ? undefined : `token ${token}`;
25302530
const installDir = yield installer.getGo(versionSpec, stable, auth);
2531-
console.log(`installDir is ${installDir}`);
25322531
core.exportVariable('GOROOT', installDir);
2533-
const content = fs_1.default.readdirSync(path_1.default.join(installDir, "go"));
2534-
console.log(content);
25352532
core.addPath(path_1.default.join(installDir, 'bin'));
25362533
console.log('Added go to the path');
25372534
let added = addBinToPath();
@@ -6932,6 +6929,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
69326929
exports.makeSemver = exports.getVersionsDist = exports.getInfoFromManifest = exports.findMatch = exports.extractGoArchive = exports.getGo = void 0;
69336930
const tc = __importStar(__webpack_require__(533));
69346931
const core = __importStar(__webpack_require__(470));
6932+
const path = __importStar(__webpack_require__(622));
69356933
const semver = __importStar(__webpack_require__(876));
69366934
const httpm = __importStar(__webpack_require__(539));
69376935
const sys = __importStar(__webpack_require__(737));
@@ -6958,7 +6956,8 @@ function getGo(versionSpec, stable, auth) {
69586956
info = yield getInfoFromManifest(makeSemver(versionSpec), stable, auth);
69596957
console.log(`info is ${info}`);
69606958
if (info) {
6961-
downloadPath = yield installGoVersion(info, auth);
6959+
const contentPath = yield installGoVersion(info, auth);
6960+
downloadPath = yield yield tc.cacheDir(contentPath, 'go', makeSemver(info.resolvedVersion));
69626961
}
69636962
else {
69646963
console.log('Not found in manifest. Falling back to download directly from Go');
@@ -6984,7 +6983,8 @@ function getGo(versionSpec, stable, auth) {
69846983
throw new Error(`Unable to find Go version '${versionSpec}' for platform ${osPlat} and architecture ${osArch}.`);
69856984
}
69866985
try {
6987-
downloadPath = yield installGoVersion(info, undefined);
6986+
const contentDir = yield installGoVersion(info, undefined);
6987+
downloadPath = yield tc.cacheDir(path.join(contentDir, "go"), 'go', makeSemver(info.resolvedVersion));
69886988
}
69896989
catch (err) {
69906990
throw new Error(`Failed to download version ${versionSpec}: ${err}`);

src/installer.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ export async function getGo(
5353
info = await getInfoFromManifest(makeSemver(versionSpec), stable, auth);
5454
console.log(`info is ${info}`);
5555
if (info) {
56-
downloadPath = await installGoVersion(info, auth);
56+
const contentPath = await installGoVersion(info, auth);
57+
downloadPath = await await tc.cacheDir(contentPath, 'go', makeSemver(info.resolvedVersion));
5758
} else {
5859
console.log(
5960
'Not found in manifest. Falling back to download directly from Go'
@@ -86,7 +87,8 @@ export async function getGo(
8687
}
8788

8889
try {
89-
downloadPath = await installGoVersion(info, undefined);
90+
const contentDir = await installGoVersion(info, undefined);
91+
downloadPath = await tc.cacheDir(path.join(contentDir, "go"), 'go', makeSemver(info.resolvedVersion));
9092
} catch (err) {
9193
throw new Error(`Failed to download version ${versionSpec}: ${err}`);
9294
}

src/main.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,7 @@ export async function run() {
2929

3030
const installDir = await installer.getGo(versionSpec, stable, auth);
3131

32-
console.log(`installDir is ${installDir}`)
3332
core.exportVariable('GOROOT', installDir);
34-
const content = fs.readdirSync(path.join(installDir, "go"));
35-
console.log(content);
3633
core.addPath(path.join(installDir, 'bin'));
3734
console.log('Added go to the path');
3835

0 commit comments

Comments
 (0)