wp-cli / language-command

Installs, activates, and manages language packs.
MIT License
13 stars 21 forks source link

exit codes for `install` subcommands #114

Open strarsis opened 1 year ago

strarsis commented 1 year ago

Describe your use case and the problem you are facing Provisioning tools as Ansible can interpret the exit code for determining whether something was updated by the command.

Describe the solution you'd like The install subcommands should have different exit codes: Whether language files were updated or not and nothing was changed.

danielbachhuber commented 1 year ago

The install subcommands should have different exit codes: Whether language files were updated or not and nothing was changed.

Which exit codes would you suggest?

Related https://github.com/wp-cli/wp-cli/issues/3577

strarsis commented 1 year ago

After some thought about it, I got doubts about using exit codes for this. Maybe just check for what the command printed, e.g. is an "updated" line there or not to find out whether something was updated or not.

danielbachhuber commented 1 year ago

Maybe just check for what the command printed, e.g. is an "updated" line there or not to find out whether something was updated or not.

@strarsis Oh, to clarify: are you suggesting a change to wp core install or wp language core install ?

strarsis commented 1 year ago

Mainly to language installs. When the language was already installed, and nothing changed. Or should be updated but was already up-to-date.

danielbachhuber commented 1 year ago

@strarsis I think we should be consistent with the behavior for the other * install commands. I don't recall exactly what they are, however. Want to look into that?