diff --git a/.scaffolder/feature/config.yml b/.scaffolder/plugin-feature/config.yml similarity index 90% rename from .scaffolder/feature/config.yml rename to .scaffolder/plugin-feature/config.yml index 629a3642..4f2ea00e 100644 --- a/.scaffolder/feature/config.yml +++ b/.scaffolder/plugin-feature/config.yml @@ -1,4 +1,4 @@ -name: create-wordpress-plugin@feature +name: create-wordpress-plugin@plugin-feature inputs: - name: featureName diff --git a/.scaffolder/feature/feature.php.hbs b/.scaffolder/plugin-feature/feature.php.hbs similarity index 100% rename from .scaffolder/feature/feature.php.hbs rename to .scaffolder/plugin-feature/feature.php.hbs diff --git a/.scaffolder/feature/test.php.hbs b/.scaffolder/plugin-feature/test.php.hbs similarity index 100% rename from .scaffolder/feature/test.php.hbs rename to .scaffolder/plugin-feature/test.php.hbs diff --git a/configure.php b/configure.php index a0fcfc3b..2a355dd6 100644 --- a/configure.php +++ b/configure.php @@ -303,7 +303,39 @@ function determine_separator( string $path ): string { * @return array */ function list_all_files_for_replacement(): array { - return explode( PHP_EOL, run( 'grep -R -l . --exclude LICENSE --exclude configure.php --exclude .phpunit.result.cache --exclude-dir .phpcs --exclude composer.lock --exclude-dir .git --exclude-dir .github --exclude-dir vendor --exclude-dir node_modules --exclude-dir modules --exclude-dir .phpcs' ) ); + $exclude = [ + 'LICENSE', + 'configure.php', + '.phpunit.result.cache', + '.phpcs', + 'composer.lock', + ]; + + $exclude_dirs = [ + '.git', + 'pantheon-mu-plugin', + 'vendor', + 'node_modules', + '.phpcs', + '.scaffolder', + ]; + + $exclude = array_map( + fn ( string $file ) => "--exclude {$file}", + $exclude, + ); + + $exclude_dirs = array_map( + fn ( string $dir ) => "--exclude-dir {$dir}", + $exclude_dirs, + ); + + return explode( + PHP_EOL, + run( + "grep -R -l . " . implode( ' ', $exclude_dirs ) . ' ' . implode( ' ', $exclude ), + ), + ); } /**