File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -181,6 +181,8 @@ Feature: Find WordPress installs on the filesystem
181181 Scenario : Ignore hidden directories by default
182182 Given a WP install in 'subdir1'
183183 And a WP install in '.svn'
184+ And I run `mkdir -p subdir2/.svn`
185+ And a WP install in 'subdir2/.svn/wp-install'
184186
185187 When I run `wp eval --skip-wordpress 'echo realpath( getenv( "RUN_DIR" ) );' `
186188 Then save STDOUT as {TEST_DIR}
@@ -194,5 +196,5 @@ Feature: Find WordPress installs on the filesystem
194196 When I run `wp find {TEST_DIR} --skip-ignored-paths --format=count`
195197 Then STDOUT should be:
196198 """
197- 2
199+ 3
198200 """
Original file line number Diff line number Diff line change @@ -200,7 +200,9 @@ private function recurse_directory( $path ) {
200200 // Assume base path doesn't need comparison
201201 $ compared_path = preg_replace ( '#^ ' . preg_quote ( $ this ->base_path ) . '# ' , '' , $ path );
202202 // Ignore all hidden system directories
203- if ( '/. ' === substr ( $ compared_path , 0 , 2 ) ) {
203+ $ bits = explode ( '/ ' , trim ( $ compared_path , '/ ' ) );
204+ $ current_dir = array_pop ( $ bits );
205+ if ( $ current_dir && '. ' === $ current_dir [0 ] ) {
204206 $ this ->log ( "Matched ignored path. Skipping recursion into ' {$ path }' " );
205207 return ;
206208 }
You can’t perform that action at this time.
0 commit comments