Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions features/makepot.feature
Original file line number Diff line number Diff line change
Expand Up @@ -620,6 +620,10 @@ Feature: Generate a POT file of a WordPress plugin
<?php
__( 'I am being ignored', 'foo-plugin' );
"""
And a foo-plugin/bar/ignored.js file:
"""
__( 'I am being ignored', 'foo-plugin' );
"""

When I run `wp i18n make-pot foo-plugin foo-plugin.pot --exclude=foo,bar`
Then the foo-plugin.pot file should not contain:
Expand Down
8 changes: 7 additions & 1 deletion src/MakePotCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,13 @@ protected function makepot( $domain ) {
] );

if ( ! $this->skip_js ) {
JsCodeExtractor::fromDirectory( $this->source, $this->translations );
JsCodeExtractor::fromDirectory(
$this->source,
$this->translations,
[
'exclude' => $this->exclude,
]
);
}
} catch ( \Exception $e ) {
WP_CLI::error( $e->getMessage() );
Expand Down