File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,8 @@ if (is_file($inputDir) && (str_ends_with($inputDir, '.lua') || str_ends_with($in
3939 $ inputDir = rtrim ($ inputDir , '/ ' );
4040 $ iterator = new RecursiveIteratorIterator (new RecursiveDirectoryIterator ($ inputDir ));
4141 $ iterator ->rewind ();
42+
43+ $ tocFiles = [];
4244 /** @var $iterator RecursiveDirectoryIterator */
4345 while ($ iterator ->valid ()) {
4446 if (
@@ -47,8 +49,24 @@ if (is_file($inputDir) && (str_ends_with($inputDir, '.lua') || str_ends_with($in
4749 ) {
4850 $ fileList [$ iterator ->getPath () . '/ ' . $ iterator ->getFilename ()] = $ iterator ->getExtension ();
4951 }
52+ if ('toc ' === $ iterator ->getExtension ()) {
53+ $ tocFiles [] = $ iterator ->getPath () . '/ ' . $ iterator ->getFilename ();
54+ }
5055 $ iterator ->next ();
5156 }
57+
58+ foreach ($ tocFiles as $ tocFile ) {
59+ $ toc = file_get_contents ($ tocFile );
60+ if (str_contains ($ toc , '## AllowLoad: glue ' )) {
61+ // remove all files with shared basepath from $fileList
62+ $ basePath = dirname ($ tocFile );
63+ foreach ($ fileList as $ filePath => $ extension ) {
64+ if (str_starts_with ($ filePath , $ basePath )) {
65+ unset($ fileList [$ filePath ]);
66+ }
67+ }
68+ }
69+ }
5270}
5371
5472$ intrinsicRegistry = new Registry ();
You can’t perform that action at this time.
0 commit comments