( cacheDependencyPath: string )
| 132 | * @return list of directories and possible |
| 133 | */ |
| 134 | const getProjectDirectoriesFromCacheDependencyPath = async ( |
| 135 | cacheDependencyPath: string |
| 136 | ): Promise<string[]> => { |
| 137 | if (projectDirectoriesMemoized !== null) { |
| 138 | return projectDirectoriesMemoized; |
| 139 | } |
| 140 | |
| 141 | const globber = await glob.create(cacheDependencyPath); |
| 142 | const cacheDependenciesPaths = await globber.glob(); |
| 143 | |
| 144 | const existingDirectories: string[] = cacheDependenciesPaths |
| 145 | .map(path.dirname) |
| 146 | .filter(unique()) |
| 147 | .map(dirName => fs.realpathSync(dirName)) |
| 148 | .filter(directory => fs.lstatSync(directory).isDirectory()); |
| 149 | |
| 150 | if (!existingDirectories.length) |
| 151 | core.warning( |
| 152 | `No existing directories found containing cache-dependency-path="${cacheDependencyPath}"` |
| 153 | ); |
| 154 | |
| 155 | projectDirectoriesMemoized = existingDirectories; |
| 156 | return existingDirectories; |
| 157 | }; |
| 158 | |
| 159 | /** |
| 160 | * Finds the cache directories configured for the repo if cache-dependency-path is not empty |
no test coverage detected