mirror of
https://github.com/actions/setup-go.git
synced 2025-04-24 01:50:52 +00:00
rebuild
This commit is contained in:
parent
9c0b5f2c57
commit
90a3d02a0c
2 changed files with 23 additions and 5 deletions
25
dist/setup/index.js
vendored
25
dist/setup/index.js
vendored
|
@ -63130,8 +63130,17 @@ const getPackageManagerInfo = (packageManager) => __awaiter(void 0, void 0, void
|
|||
});
|
||||
exports.getPackageManagerInfo = getPackageManagerInfo;
|
||||
const getCacheDirectoryPath = (packageManagerInfo) => __awaiter(void 0, void 0, void 0, function* () {
|
||||
const pathList = yield Promise.all(packageManagerInfo.cacheFolderCommandList.map((command) => __awaiter(void 0, void 0, void 0, function* () { return exports.getCommandOutput(command); })));
|
||||
const cachePaths = pathList.filter(item => item);
|
||||
const pathOutputs = yield Promise.allSettled(packageManagerInfo.cacheFolderCommandList.map((command) => __awaiter(void 0, void 0, void 0, function* () { return exports.getCommandOutput(command); })));
|
||||
const results = pathOutputs.map(item => {
|
||||
if (item.status === 'fulfilled') {
|
||||
return item.value;
|
||||
}
|
||||
else {
|
||||
core.info(`[warning]getting cache directory path failed: ${item.reason}`);
|
||||
}
|
||||
return '';
|
||||
});
|
||||
const cachePaths = results.filter(item => item);
|
||||
if (!cachePaths.length) {
|
||||
throw new Error(`Could not get cache folder paths.`);
|
||||
}
|
||||
|
@ -63596,16 +63605,24 @@ function run() {
|
|||
core.info('Setting GOROOT for Go version < 1.9');
|
||||
core.exportVariable('GOROOT', installDir);
|
||||
}
|
||||
core.info(`Successfully set up Go version ${versionSpec}`);
|
||||
}
|
||||
else {
|
||||
core.info('[warning]go-version input was not specified. The action will try to use pre-installed version.');
|
||||
}
|
||||
const added = yield addBinToPath();
|
||||
core.debug(`add bin ${added}`);
|
||||
core.info(`Successfully set up Go version ${versionSpec}`);
|
||||
const goPath = yield io.which('go');
|
||||
const goVersion = (child_process_1.default.execSync(`${goPath} version`) || '').toString();
|
||||
if (cache && cache_utils_1.isCacheFeatureAvailable()) {
|
||||
const packageManager = 'default';
|
||||
const cacheDependencyPath = core.getInput('cache-dependency-path');
|
||||
yield cache_restore_1.restoreCache(parseGoVersion(goVersion), packageManager, cacheDependencyPath);
|
||||
try {
|
||||
yield cache_restore_1.restoreCache(parseGoVersion(goVersion), packageManager, cacheDependencyPath);
|
||||
}
|
||||
catch (error) {
|
||||
core.warning(`Restore cache failed: ${error.message}`);
|
||||
}
|
||||
}
|
||||
// add problem matchers
|
||||
const matchersPath = path_1.default.join(__dirname, '../..', 'matchers.json');
|
||||
|
|
|
@ -50,6 +50,8 @@ export async function run() {
|
|||
core.info('Setting GOROOT for Go version < 1.9');
|
||||
core.exportVariable('GOROOT', installDir);
|
||||
}
|
||||
|
||||
core.info(`Successfully set up Go version ${versionSpec}`);
|
||||
} else {
|
||||
core.info(
|
||||
'[warning]go-version input was not specified. The action will try to use pre-installed version.'
|
||||
|
@ -58,7 +60,6 @@ export async function run() {
|
|||
|
||||
const added = await addBinToPath();
|
||||
core.debug(`add bin ${added}`);
|
||||
core.info(`Successfully set up Go version ${versionSpec}`);
|
||||
|
||||
const goPath = await io.which('go');
|
||||
const goVersion = (cp.execSync(`${goPath} version`) || '').toString();
|
||||
|
|
Loading…
Add table
Reference in a new issue