Skip to content

Commit 13ce559

Browse files
committed
dist/
1 parent 6aacde7 commit 13ce559

File tree

2 files changed

+4
-21
lines changed

2 files changed

+4
-21
lines changed

src/cache-restore.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export const restoreCache = async (
3737
);
3838
}
3939

40-
const primaryKey = `node-cache-${platform}-${packageManager}-v2-${fileHash}`;
40+
const primaryKey = `node-cache-${platform}-${packageManager}-${fileHash}`;
4141
core.debug(`primary key is ${primaryKey}`);
4242

4343
core.saveState(State.CachePrimaryKey, primaryKey);

src/cache-utils.ts

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,6 @@ export const getPackageManagerInfo = async (packageManager: string) => {
110110
}
111111
};
112112

113-
/**
114-
* glob expanding memoized because it involves potentially very deep
115-
* traversing through the directories tree
116-
*/
117-
export const memoizedCacheDependencies: Record<string, string[]> = {};
118113
/**
119114
* Expands (converts) the string input `cache-dependency-path` to list of directories that
120115
* may be project roots
@@ -125,29 +120,17 @@ export const memoizedCacheDependencies: Record<string, string[]> = {};
125120
const getProjectDirectoriesFromCacheDependencyPath = async (
126121
cacheDependencyPath: string
127122
): Promise<string[]> => {
128-
let cacheDependenciesPaths: string[];
129-
130-
// memoize unglobbed paths to avoid traversing FS
131-
const memoized = memoizedCacheDependencies[cacheDependencyPath];
132-
if (memoized) {
133-
cacheDependenciesPaths = memoized;
134-
} else {
135-
const globber = await glob.create(cacheDependencyPath);
136-
cacheDependenciesPaths = await globber.glob();
137-
memoizedCacheDependencies[cacheDependencyPath] = cacheDependenciesPaths;
138-
}
123+
const globber = await glob.create(cacheDependencyPath);
124+
const cacheDependenciesPaths = await globber.glob();
139125

140126
const existingDirectories: string[] = cacheDependenciesPaths
141127
.map(path.dirname)
142128
.filter(unique())
143129
.filter(fs.existsSync)
144130
.filter(directory => fs.lstatSync(directory).isDirectory());
145131

146-
// if user explicitly pointed out some file, but it does not exist it is definitely
147-
// not he wanted, thus we should throw an error not trying to workaround with unexpected
148-
// result to the whole build
149132
if (!existingDirectories.length)
150-
throw Error(
133+
core.warning(
151134
'No existing directories found containing `cache-dependency-path`="${cacheDependencyPath}"'
152135
);
153136

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy