File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,18 @@ module.exports = {
3939
4040 init ( ) {
4141 this . _super . init && this . _super . init . apply ( this , arguments ) ;
42+ this . _existsCache = new Map ( ) ;
43+ } ,
44+
45+ existsSync ( path ) {
46+ if ( this . _existsCache . has ( path ) ) {
47+ return this . _existsCache . get ( path ) ;
48+ }
49+
50+ const exists = existsSync ( path ) ;
51+
52+ this . _existsCache . set ( path , exists ) ;
53+ return exists ;
4254 } ,
4355
4456 /**
@@ -139,7 +151,7 @@ module.exports = {
139151 const currentAddonFastbootPath = path . join ( addon . root , 'fastboot' ) ;
140152
141153 let fastbootTree ;
142- if ( existsSync ( currentAddonFastbootPath ) ) {
154+ if ( this . existsSync ( currentAddonFastbootPath ) ) {
143155 fastbootTree = this . treeGenerator ( currentAddonFastbootPath ) ;
144156 }
145157
@@ -168,7 +180,7 @@ module.exports = {
168180
169181 // check the parent containing the fastboot directory
170182 const projectFastbootPath = path . join ( this . project . root , 'fastboot' ) ;
171- if ( existsSync ( projectFastbootPath ) ) {
183+ if ( this . existsSync ( projectFastbootPath ) ) {
172184 let fastbootTree = this . treeGenerator ( projectFastbootPath ) ;
173185 fastbootTrees . push ( fastbootTree ) ;
174186 }
You can’t perform that action at this time.
0 commit comments