MCPcopy Create free account
hub / github.com/actions/setup-go / getCacheDirectoryPath

Function getCacheDirectoryPath

src/cache-utils.ts:34–60  ·  view source on GitHub ↗
(
  packageManagerInfo: PackageManagerInfo
)

Source from the content-addressed store, hash-verified

32};
33
34export const getCacheDirectoryPath = async (
35 packageManagerInfo: PackageManagerInfo
36) => {
37 const pathOutputs = await Promise.allSettled(
38 packageManagerInfo.cacheFolderCommandList.map(async command =>
39 getCommandOutput(command)
40 )
41 );
42
43 const results = pathOutputs.map(item => {
44 if (item.status === 'fulfilled') {
45 return item.value;
46 } else {
47 core.info(`[warning]getting cache directory path failed: ${item.reason}`);
48 }
49
50 return '';
51 });
52
53 const cachePaths = results.filter(item => item);
54
55 if (!cachePaths.length) {
56 throw new Error(`Could not get cache folder paths.`);
57 }
58
59 return cachePaths;
60};
61
62export function isGhes(): boolean {
63 const ghUrl = new URL(

Callers 2

restoreCacheFunction · 0.90
cachePackagesFunction · 0.90

Calls 1

getCommandOutputFunction · 0.85

Tested by

no test coverage detected