I've been running my command as a module command to get around #2918, and it's been working ok.
Now I'm testing the PR to fix that issue, #3052, and my command crashes.
The reason is that my call to drush_drupal_version() in my command's hook_init gets a FALSE, where before it got a version number.
Here's some test code:
/**
* Test hello.
*
* @command cb-hi
* @bootstrap DRUSH_BOOTSTRAP_DRUPAL_FULL
*/
public function commandHi() {
dump(drush_drupal_version());
dump('hello!');
}
/**
* Initialize Drupal Code Builder before a command runs.
*
* @hook init cb-hi
*/
public function initHi() {
dump(drush_drupal_version());
dump('init');
}
The output running that as a global command is is:
false
"init"
"8.4.0-dev"
"hello!"
Whereas if running as a module command, the Drupal core version number would be output both times.