File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ import {
2020} from "../../definitions/project" ;
2121import { IInjector } from "../definitions/yok" ;
2222import { injector } from "../yok" ;
23- import { cache } from "../decorators" ;
23+ import { memoize } from "../decorators" ;
2424
2525class Hook implements IHook {
2626 constructor ( public name : string , public fullPath : string ) { }
@@ -51,7 +51,14 @@ export class HooksService implements IHooksService {
5151 return "hookArgs" ;
5252 }
5353
54- @cache ( )
54+ @memoize ( {
55+ shouldCache ( ) {
56+ // only cache if we have hooks directories, the only case to
57+ // not have hooks directories is when the project dir is
58+ // not set yet, ie. when creating a project.
59+ return ! ! this . hooksDirectories . length ;
60+ } ,
61+ } )
5562 private initialize ( projectDir : string ) : void {
5663 this . cachedHooks = { } ;
5764
You can’t perform that action at this time.
0 commit comments