Skip to content

Commit 91b037f

Browse files
Quote all paths, per WP-CLI doc standards
1 parent 98da69f commit 91b037f

2 files changed

Lines changed: 22 additions & 22 deletions

File tree

features/find.feature

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ Feature: Find WordPress installs on the filesystem
1717
When I run `wp find {TEST_DIR} --field=version_path --verbose`
1818
Then STDOUT should contain:
1919
"""
20-
Found WordPress install at {TEST_DIR}/subdir1/wp-includes/version.php
20+
Found WordPress install at '{TEST_DIR}/subdir1/wp-includes/version.php'
2121
"""
2222
And STDOUT should contain:
2323
"""
24-
Found WordPress install at {TEST_DIR}/subdir2/wp-includes/version.php
24+
Found WordPress install at '{TEST_DIR}/subdir2/wp-includes/version.php'
2525
"""
2626

2727
When I run `wp find {TEST_DIR} --format=count`
@@ -41,19 +41,19 @@ Feature: Find WordPress installs on the filesystem
4141
When I run `wp find {TEST_DIR} --field=version_path --verbose`
4242
Then STDOUT should contain:
4343
"""
44-
Found WordPress install at {TEST_DIR}/subdir1/wp-includes/version.php
44+
Found WordPress install at '{TEST_DIR}/subdir1/wp-includes/version.php'
4545
"""
4646
And STDOUT should not contain:
4747
"""
48-
Found WordPress install at {TEST_DIR}/subdir2/wp-includes/version.php
48+
Found WordPress install at '{TEST_DIR}/subdir2/wp-includes/version.php'
4949
"""
5050
And STDOUT should contain:
5151
"""
52-
Matched ignored path. Skipping recursion into {TEST_DIR}/cache
52+
Matched ignored path. Skipping recursion into '{TEST_DIR}/cache/'
5353
"""
5454
And STDOUT should contain:
5555
"""
56-
Matched ignored path. Skipping recursion into {TEST_DIR}/tmp
56+
Matched ignored path. Skipping recursion into '{TEST_DIR}/tmp/'
5757
"""
5858

5959
When I run `wp find {TEST_DIR} --format=count`
@@ -80,15 +80,15 @@ Feature: Find WordPress installs on the filesystem
8080
When I run `wp find {TEST_DIR} --verbose`
8181
Then STDOUT should contain:
8282
"""
83-
Found WordPress install at {TEST_DIR}/subdir1/wp-includes/version.php
83+
Found WordPress install at '{TEST_DIR}/subdir1/wp-includes/version.php'
8484
"""
8585
And STDOUT should contain:
8686
"""
87-
Found WordPress install at {TEST_DIR}/sub/subdir2/wp-includes/version.php
87+
Found WordPress install at '{TEST_DIR}/sub/subdir2/wp-includes/version.php'
8888
"""
8989
And STDOUT should contain:
9090
"""
91-
Found WordPress install at {TEST_DIR}/sub/sub/subdir3/wp-includes/version.php
91+
Found WordPress install at '{TEST_DIR}/sub/sub/subdir3/wp-includes/version.php'
9292
"""
9393

9494
When I run `wp find {TEST_DIR} --format=count`
@@ -100,15 +100,15 @@ Feature: Find WordPress installs on the filesystem
100100
When I run `wp find {TEST_DIR} --verbose --max_depth=2`
101101
Then STDOUT should contain:
102102
"""
103-
Found WordPress install at {TEST_DIR}/subdir1/wp-includes/version.php
103+
Found WordPress install at '{TEST_DIR}/subdir1/wp-includes/version.php'
104104
"""
105105
And STDOUT should contain:
106106
"""
107-
Found WordPress install at {TEST_DIR}/sub/subdir2/wp-includes/version.php
107+
Found WordPress install at '{TEST_DIR}/sub/subdir2/wp-includes/version.php'
108108
"""
109109
And STDOUT should contain:
110110
"""
111-
Exceeded max depth. Skipping recursion into {TEST_DIR}/sub/sub/subdir3/
111+
Exceeded max depth. Skipping recursion into '{TEST_DIR}/sub/sub/subdir3/'
112112
"""
113113

114114
When I run `wp find {TEST_DIR} --format=count --max_depth=2`
@@ -120,15 +120,15 @@ Feature: Find WordPress installs on the filesystem
120120
When I run `wp find {TEST_DIR} --verbose --max_depth=1`
121121
Then STDOUT should contain:
122122
"""
123-
Found WordPress install at {TEST_DIR}/subdir1/wp-includes/version.php
123+
Found WordPress install at '{TEST_DIR}/subdir1/wp-includes/version.php'
124124
"""
125125
And STDOUT should contain:
126126
"""
127-
Exceeded max depth. Skipping recursion into {TEST_DIR}/sub/subdir2/
127+
Exceeded max depth. Skipping recursion into '{TEST_DIR}/sub/subdir2/'
128128
"""
129129
And STDOUT should contain:
130130
"""
131-
Exceeded max depth. Skipping recursion into {TEST_DIR}/sub/sub/
131+
Exceeded max depth. Skipping recursion into '{TEST_DIR}/sub/sub/'
132132
"""
133133

134134
When I run `wp find {TEST_DIR} --format=count --max_depth=1`
@@ -140,11 +140,11 @@ Feature: Find WordPress installs on the filesystem
140140
When I run `wp find {TEST_DIR} --verbose --max_depth=0`
141141
Then STDOUT should contain:
142142
"""
143-
Exceeded max depth. Skipping recursion into {TEST_DIR}/subdir1/
143+
Exceeded max depth. Skipping recursion into '{TEST_DIR}/subdir1/'
144144
"""
145145
And STDOUT should contain:
146146
"""
147-
Exceeded max depth. Skipping recursion into {TEST_DIR}/sub/
147+
Exceeded max depth. Skipping recursion into '{TEST_DIR}/sub/'
148148
"""
149149

150150
When I run `wp find {TEST_DIR} --format=count --max_depth=0`

src/Find_Command.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ public function __invoke( $args, $assoc_args ) {
145145
$this->max_depth = Utils\get_flag_value( $assoc_args, 'max_depth', false );
146146
$this->verbose = Utils\get_flag_value( $assoc_args, 'verbose' );
147147
$this->start_time = microtime( true );
148-
$this->log( "Searching for WordPress installs in {$path}" );
148+
$this->log( "Searching for WordPress installs in '{$path}'" );
149149
$this->recurse_directory( $this->base_path );
150150
$formatter = new \WP_CLI\Formatter( $assoc_args, array( 'version_path', 'version', 'depth' ) );
151151
$formatter->display_items( $this->found_wp );
@@ -167,7 +167,7 @@ private function recurse_directory( $path ) {
167167
$compared_path = preg_replace( '#^' . preg_quote( $this->base_path ) . '#', '', $path );
168168
foreach( $this->ignored_paths as $ignored_path ) {
169169
if ( false !== stripos( $compared_path, $ignored_path ) ) {
170-
$this->log( "Matched ignored path. Skipping recursion into {$path}" );
170+
$this->log( "Matched ignored path. Skipping recursion into '{$path}'" );
171171
return;
172172
}
173173
}
@@ -183,19 +183,19 @@ private function recurse_directory( $path ) {
183183
'version' => self::get_wp_version( $version_path ),
184184
'depth' => $this->current_depth - 1,
185185
);
186-
$this->log( "Found WordPress install at {$version_path}" );
186+
$this->log( "Found WordPress install at '{$version_path}'" );
187187
return;
188188
}
189189

190190
// Ensure we haven't exceeded our max recursion depth
191191
if ( false !== $this->max_depth && $this->current_depth > $this->max_depth ) {
192-
$this->log( "Exceeded max depth. Skipping recursion into {$path}" );
192+
$this->log( "Exceeded max depth. Skipping recursion into '{$path}'" );
193193
return;
194194
}
195195

196196
// Check all files and directories of this path to recurse
197197
// into subdirectories.
198-
$this->log( "Recusing into {$path}" );
198+
$this->log( "Recusing into '{$path}'" );
199199
$iterator = new RecursiveDirectoryIterator( $path, FilesystemIterator::SKIP_DOTS );
200200
foreach( $iterator as $file_info ) {
201201
if ( $file_info->isDir() ) {

0 commit comments

Comments
 (0)