Skip to content

Commit 5c74b07

Browse files
authored
Speed up the orphaned files check (#56010)
1 parent 95f2c30 commit 5c74b07

File tree

1 file changed

+4
-1
lines changed
  • src/content-render/scripts/reusables-cli

1 file changed

+4
-1
lines changed

src/content-render/scripts/reusables-cli/shared.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,14 +100,17 @@ export function resolveReusablePath(reusablePath: string): string {
100100
}
101101
}
102102

103+
let paths: string[]
103104
export function getAllReusablesFilePaths(): string[] {
104-
return filterFiles(
105+
if (paths) return paths!
106+
paths = filterFiles(
105107
walk(reusablesDirectory, {
106108
includeBasePath: true,
107109
directories: false,
108110
ignore: ['**/README.md', 'enterprise_deprecation/**'],
109111
}),
110112
)
113+
return paths
111114
}
112115

113116
export function findIndicesOfSubstringInString(substr: string, str: string): number[] {

0 commit comments

Comments
 (0)