review updates

This commit is contained in:
Sergey Dolin 2023-06-08 13:44:41 +02:00
parent b8b9502971
commit 6aacde798c
9 changed files with 222 additions and 245 deletions

12
dist/setup/index.js vendored
View file

@ -71145,6 +71145,7 @@ const restoreCache = (packageManager, cacheDependencyPath) => __awaiter(void 0,
}
const platform = process.env.RUNNER_OS;
const cachePaths = yield cache_utils_1.getCacheDirectories(packageManagerInfo, cacheDependencyPath);
core.saveState(constants_1.State.CachePaths, cachePaths);
const lockFilePath = cacheDependencyPath
? cacheDependencyPath
: findLockFile(packageManagerInfo);
@ -71306,19 +71307,18 @@ const getProjectDirectoriesFromCacheDependencyPath = (cacheDependencyPath) => __
}
else {
const globber = yield glob.create(cacheDependencyPath);
cacheDependenciesPaths = (yield globber.glob()) || [''];
cacheDependenciesPaths = yield globber.glob();
exports.memoizedCacheDependencies[cacheDependencyPath] = cacheDependenciesPaths;
}
const existingDirectories = cacheDependenciesPaths
.map(path_1.default.dirname)
.filter(path => path != null)
.filter(util_1.unique())
.filter(fs_1.default.existsSync)
.filter(directory => fs_1.default.lstatSync(directory).isDirectory());
// if user explicitly pointed out some file, but it does not exist it is definitely
// not he wanted, thus we should throw an error not trying to workaround with unexpected
// result to the whole build
if (existingDirectories.length === 0)
if (!existingDirectories.length)
throw Error('No existing directories found containing `cache-dependency-path`="${cacheDependencyPath}"');
return existingDirectories;
});
@ -71331,9 +71331,8 @@ const getProjectDirectoriesFromCacheDependencyPath = (cacheDependencyPath) => __
*/
const getCacheDirectoriesFromCacheDependencyPath = (packageManagerInfo, cacheDependencyPath) => __awaiter(void 0, void 0, void 0, function* () {
const projectDirectories = yield getProjectDirectoriesFromCacheDependencyPath(cacheDependencyPath);
const cacheFoldersPaths = yield Promise.all(projectDirectories.map(projectDirectory => packageManagerInfo
.getCacheFolderPath(projectDirectory)
.then(cacheFolderPath => {
const cacheFoldersPaths = yield Promise.all(projectDirectories.map((projectDirectory) => __awaiter(void 0, void 0, void 0, function* () {
const cacheFolderPath = packageManagerInfo.getCacheFolderPath(projectDirectory);
core.debug(`${packageManagerInfo.name}'s cache folder "${cacheFolderPath}" configured for the directory "${projectDirectory}"`);
return cacheFolderPath;
})));
@ -71404,6 +71403,7 @@ var State;
(function (State) {
State["CachePrimaryKey"] = "CACHE_KEY";
State["CacheMatchedKey"] = "CACHE_RESULT";
State["CachePaths"] = "CACHE_PATHS";
})(State = exports.State || (exports.State = {}));
var Outputs;
(function (Outputs) {