Skip to content
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

is-installed for themes and plugins should only support one language code #48

Open
ocean90 opened this issue Aug 9, 2018 · 3 comments

Comments

@ocean90
Copy link
Contributor

ocean90 commented Aug 9, 2018

2660f96 added support for is-installed to language core and follows the core/plugin/theme commands. All the commands only support one object to check for. This makes sense because the return value is only 0 or 1.

In 51a5ff0 this was also added to language plugin/theme but in this case it also supports passing multiple language codes. This made the genreal behaviour of is-installed inconsistent and I'm wondering why someone would use this since you'd never know which language code isn't installed.

@schlessera
Copy link
Member

If your use case is to verify whether all requirements are set and bail if not, then this can do it in one command.

For quick & dirty setup, for example, you could do something like this:

if ! wp plugin is-installed gutenberg en_US de_DE fr_FR nl_NL; then
    wp plugin install gutenberg en_US de_DE fr_FR nl_NL
fi

Otherwise, you are still able to only pass in a single plugin/theme at a time.

So yes, while it is debatable whether one can make proper use of this, it is not an error per se, and the more useful behavior is not blocked because of it.

@schlessera
Copy link
Member

Of course this makes it inconsistent with the existing core language is-installed command then. So we should discuss whether we change one or the other to make them more consistent.

@swissspidy
Copy link
Member

Hmm yeah I probably should only have added support for one locale to be passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants