@@ -67,58 +67,28 @@ const allCanonicalCetFiles = (files: string[]) =>
6767const matchCetInitLua = ( filePath : string ) : boolean =>
6868 path . basename ( filePath ) === CET_MOD_CANONICAL_INIT_FILE ;
6969
70- const notMatchCetInitLua = ( filePath : string ) : boolean =>
71- path . basename ( filePath ) !== CET_MOD_CANONICAL_INIT_FILE ;
72-
7370const findCanonicalCetDirs = ( fileTree : FileTree ) : string [ ] =>
7471 findDirectSubdirsWithSome ( CET_MOD_CANONICAL_PATH_PREFIX , matchCetInitLua , fileTree ) ;
7572
76- const findPluginCetDirs = ( fileTree : FileTree ) : string [ ] =>
77- findDirectSubdirsWithSome ( CET_MOD_CANONICAL_PATH_PREFIX , notMatchCetInitLua , fileTree ) ;
78-
7973export const detectCetCanonLayout = ( fileTree : FileTree ) : boolean =>
8074 // don't worry about correctness so much here. if there is one valid cet mod, that is good enough
8175 findCanonicalCetDirs ( fileTree ) . length > 0 ;
8276
83- export const detectCetPluginLayout = ( fileTree : FileTree ) : boolean =>
84- // don't worry about correctness so much here. if there is one valid cet mod, that is good enough
85- findPluginCetDirs ( fileTree ) . length > 0 ;
86-
87- export const cetCanonLayout = (
77+ export const cetLazyLayout = (
8878 api : VortexApi ,
8979 _modName : string ,
9080 fileTree : FileTree ,
9181) : MaybeInstructions => {
92- const allCanonCetFiles = findCanonicalCetDirs ( fileTree ) . flatMap ( ( namedSubdir ) =>
93- filesUnder ( namedSubdir , Glob . Any , fileTree ) ) ;
82+ const allCetFiles = filesUnder ( CET_MOD_CANONICAL_PATH_PREFIX , Glob . Any , fileTree ) ;
9483
95- if ( allCanonCetFiles . length < 1 ) {
84+ if ( allCetFiles . length < 1 ) {
9685 api . log ( `debug` , `No canonical CET files found.` ) ;
9786 return NoInstructions . NoMatch ;
9887 }
9988
10089 return {
10190 kind : CetLayout . Canon ,
102- instructions : instructionsForSameSourceAndDestPaths ( allCanonCetFiles ) ,
103- } ;
104- } ;
105-
106- export const cetPluginLayout = (
107- api : VortexApi ,
108- _modName : string ,
109- fileTree : FileTree ,
110- ) : MaybeInstructions => {
111- const allCanonCetFiles = findPluginCetDirs ( fileTree ) . flatMap ( ( namedSubdir ) =>
112- filesUnder ( namedSubdir , Glob . Any , fileTree ) ) ;
113-
114- if ( allCanonCetFiles . length < 1 ) {
115- api . log ( `debug` , `No plugin CET files found.` ) ;
116- return NoInstructions . NoMatch ;
117- }
118-
119- return {
120- kind : CetLayout . PluginOnly ,
121- instructions : instructionsForSameSourceAndDestPaths ( allCanonCetFiles ) ,
91+ instructions : instructionsForSameSourceAndDestPaths ( allCetFiles ) ,
12292 } ;
12393} ;
12494
0 commit comments