mirror of
https://github.com/actions/setup-go.git
synced 2025-06-30 05:03:43 +00:00
Fix review points
This commit is contained in:
parent
832658fa34
commit
ede5159e42
2 changed files with 16 additions and 18 deletions
|
@ -35,19 +35,20 @@ const cachePackages = async () => {
|
|||
|
||||
const cachePaths = await getCacheDirectoryPath(packageManagerInfo);
|
||||
|
||||
let pathsCounter = cachePaths.length;
|
||||
const nonExistingPaths = cachePaths.filter(
|
||||
cachePath => !fs.existsSync(cachePath)
|
||||
);
|
||||
|
||||
for (let path of cachePaths) {
|
||||
if (!fs.existsSync(path)) {
|
||||
logWarning(
|
||||
`Cache folder path is retrieved but doesn't exist on disk: ${path}`
|
||||
);
|
||||
pathsCounter--;
|
||||
}
|
||||
if (nonExistingPaths.length === cachePaths.length) {
|
||||
throw new Error(`No cache folders exist on disk`);
|
||||
}
|
||||
|
||||
if (!pathsCounter) {
|
||||
throw new Error(`No cache folders exist on disk`);
|
||||
if (nonExistingPaths.length) {
|
||||
logWarning(
|
||||
`Cache folder path is retrieved but doesn't exist on disk: ${nonExistingPaths.join(
|
||||
', '
|
||||
)}`
|
||||
);
|
||||
}
|
||||
|
||||
if (primaryKey === state) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue