Skip to content

Commit

Permalink
Wrap up feature for generating a plugin feature
Browse files Browse the repository at this point in the history
  • Loading branch information
srtfisher committed Feb 7, 2024
1 parent ca29f44 commit 7b3f211
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: create-wordpress-plugin@feature
name: create-wordpress-plugin@plugin-feature

inputs:
- name: featureName
Expand Down
File renamed without changes.
File renamed without changes.
34 changes: 33 additions & 1 deletion configure.php
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,39 @@ function determine_separator( string $path ): string {
* @return array<int, string>
*/
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 ),
),
);
}

/**
Expand Down

0 comments on commit 7b3f211

Please sign in to comment.