mirror of
https://code.forgejo.org/actions/setup-go
synced 2025-06-09 12:02:26 +02:00
Enable caching by default with default input (#332)
This commit is contained in:
parent
6b848af622
commit
c51a720768
9 changed files with 167 additions and 6269 deletions
|
@ -34,13 +34,23 @@ export const getPackageManagerInfo = async (packageManager: string) => {
|
|||
export const getCacheDirectoryPath = async (
|
||||
packageManagerInfo: PackageManagerInfo
|
||||
) => {
|
||||
const pathList = await Promise.all(
|
||||
const pathOutputs = await Promise.allSettled(
|
||||
packageManagerInfo.cacheFolderCommandList.map(async command =>
|
||||
getCommandOutput(command)
|
||||
)
|
||||
);
|
||||
|
||||
const cachePaths = pathList.filter(item => item);
|
||||
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.`);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue