MCPcopy Index your code
hub / github.com/actions/setup-node / getCacheDirectoriesFromCacheDependencyPath

Function getCacheDirectoriesFromCacheDependencyPath

src/cache-utils.ts:166–184  ·  view source on GitHub ↗
(
  packageManagerInfo: PackageManagerInfo,
  cacheDependencyPath: string
)

Source from the content-addressed store, hash-verified

164 * @return list of files on which the cache depends
165 */
166const getCacheDirectoriesFromCacheDependencyPath = async (
167 packageManagerInfo: PackageManagerInfo,
168 cacheDependencyPath: string
169): Promise<string[]> => {
170 const projectDirectories =
171 await getProjectDirectoriesFromCacheDependencyPath(cacheDependencyPath);
172 const cacheFoldersPaths = await Promise.all(
173 projectDirectories.map(async projectDirectory => {
174 const cacheFolderPath =
175 await packageManagerInfo.getCacheFolderPath(projectDirectory);
176 core.debug(
177 `${packageManagerInfo.name}'s cache folder "${cacheFolderPath}" configured for the directory "${projectDirectory}"`
178 );
179 return cacheFolderPath;
180 })
181 );
182 // uniq in order to do not cache the same directories twice
183 return cacheFoldersPaths.filter(unique());
184};
185
186/**
187 * Finds the cache directories configured for the repo ignoring cache-dependency-path

Callers 1

getCacheDirectoriesFunction · 0.85

Calls 2

uniqueFunction · 0.90

Tested by

no test coverage detected