@@ -89,6 +89,8 @@ private function addMissingIndexFiles(): void
8989 foreach ($ this ->getDirectoryIterator () as $ fileInfo ) {
9090 $ this ->addIndex ($ fileInfo );
9191 }
92+ // also at the root - I haven't found a way to include it in the iterator :/
93+ $ this ->addIndex (new \SplFileInfo ($ this ->getcwd ()));
9294 }
9395
9496 private function addIndex (\SplFileInfo $ splFileInfo ): void
@@ -107,16 +109,22 @@ private function checkMissingIndexes(): int
107109 $ indexPhpPath = $ fileInfo ->getPathname () . '/index.php ' ;
108110 $ this ->fs ->exists ($ indexPhpPath ) ?: array_push ($ missingIndexFiles , $ indexPhpPath );
109111 }
112+ // plus index.php at root
113+ $ this ->fs ->exists ($ this ->getcwd () . '/index.php ' ) ?: array_push ($ missingIndexFiles , './index.php ' );
110114
111115 if (empty ($ missingIndexFiles )) {
112116 $ this ->getIO ()->write ('Good : no missing index files. ' );
113117
114118 return 0 ;
115119 }
116120
117- $ this ->getIO ()->write (':( Missing index.php files. ' );
121+ $ this ->getIO ()->write ('<fg=red>✗ Missing index.php files.</> ' );
122+ $ this ->getIO ()->write ('Missing index.php : ' , true , IOInterface::VERBOSE );
118123 $ this ->getIO ()->write ($ missingIndexFiles , true , IOInterface::VERBOSE );
119- $ this ->getIO ()->write (['Use <info>-v</info> option to list missing files ' , 'Remove <info>--check-only</info> option to add missing files. ' ]);
124+ $ this ->getIO ()->write ([
125+ sprintf ('Run <info>composer psdt:%s --check-only -v</info> option to list missing files ' , $ this ->getName ()),
126+ sprintf ('Or run <info>composer psdt:%s</info> to add missing files. ' , $ this ->getName ()),
127+ ]);
120128
121129 return 1 ;
122130 }
@@ -144,6 +152,8 @@ private function getDirectoryIterator()
144152 return (new Finder ())
145153 ->in ($ this ->getcwd ())
146154 ->directories ()
155+ ->ignoreDotFiles (false )
156+ ->ignoreVCS (true )
147157 ->exclude ('vendor ' )
148158 ->getIterator ();
149159 }
0 commit comments