@@ -110,11 +110,6 @@ export const getPackageManagerInfo = async (packageManager: string) => {
110
110
}
111
111
} ;
112
112
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 [ ] > = { } ;
118
113
/**
119
114
* Expands (converts) the string input `cache-dependency-path` to list of directories that
120
115
* may be project roots
@@ -125,29 +120,17 @@ export const memoizedCacheDependencies: Record<string, string[]> = {};
125
120
const getProjectDirectoriesFromCacheDependencyPath = async (
126
121
cacheDependencyPath : string
127
122
) : 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 ( ) ;
139
125
140
126
const existingDirectories : string [ ] = cacheDependenciesPaths
141
127
. map ( path . dirname )
142
128
. filter ( unique ( ) )
143
129
. filter ( fs . existsSync )
144
130
. filter ( directory => fs . lstatSync ( directory ) . isDirectory ( ) ) ;
145
131
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
149
132
if ( ! existingDirectories . length )
150
- throw Error (
133
+ core . warning (
151
134
'No existing directories found containing `cache-dependency-path`="${cacheDependencyPath}"'
152
135
) ;
153
136
0 commit comments