New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not possible to include vendor
#84
Comments
You're right, it's currently not possible to override built-in excludes. However, it was a conscious decision to only exclude a specific, limited set of files and folders. What is your use case exactly?
|
We have split a WordPress plugin into a number of Composer packages, but they share the same text domain. Probably not the best design, but for now we can't change this very easily. I also don't know how it works with multiple text domains in one plugin and the https://translate.wordpress.org/projects/wp-plugins/ translation platform. For now fixed it with a custom <?php
namespace Pronamic\WordPress\Pay;
class MakePotCommand extends \WP_CLI\I18n\MakePotCommand {
public function __construct() {
parent::__construct();
// https://github.com/wp-cli/i18n-command/blob/v2.0.1/src/MakePotCommand.php#L36-L44
$this->exclude = array_diff( $this->exclude, array(
'vendor',
) );
$this->exclude = array_merge( $this->exclude, array(
'build',
'deploy',
'documentation',
'etc',
'repositories',
'wordpress',
'wp-content',
) );
$this->include = array(
'admin',
'includes',
'templates',
'vendor',
'views',
);
}
}
// https://github.com/wp-cli/i18n-command/blob/v2.0.1/i18n-command.php
\WP_CLI::add_command( 'pronamic i18n make-pot', '\Pronamic\WordPress\Pay\MakePotCommand' );
// wp pronamic i18n make-pot . languages/pronamic_ideal.pot --slug="pronamic-ideal" |
Have you tried out using a different folder for your plugin's dependencies in the meantime? For this, the dependencies simply need to require {
"extra":{
"installer-paths": {
"lib": ["remcotolsma/some-package", "remcotolsma/some-other-package"]
}
}
} This would be a bit easier than having to maintain a custom command. Of course this only solves the problem for I would have to think about how to best handle this if it turns out to be a major use case for other paths as well. |
@swissspidy How about having |
We could give it a go, sure. Ideally we merge #83 first so we have some unit tests where we can more easily catch regressions. |
@swissspidy Thanks for the It would also be nice if the I also noted that if you for example exclude
Is there not an existing library which can handle the |
@remcotolsma With the merged PR #87 , you can now add |
It looks like it's not possible to include the
vendor
folder in themake-pot
command:We have a few plugins where we require to include the
vendor
folder, how can we do this?The text was updated successfully, but these errors were encountered: