hechoendrupal / drupal-console

The Drupal CLI. A tool to generate boilerplate code, interact with and debug Drupal.
http://drupalconsole.com
GNU General Public License v2.0
939 stars 558 forks source link

Any way to set a defaut site to use on multisite ? #3810

Open steveoriol opened 6 years ago

steveoriol commented 6 years ago

Hello, I use multisite installation and the console works when I use "--uri=[site-name]" as option.

but, if I forget the "--uri=[site-name]" I get: [ERROR] The specified database connection is not defined: default

or for the command "drupal debug:multisite" that should list all multi-sites available in system. I get: [ERROR] Command "debug:multisite", is not a valid command name.

Is it possible to define an "--uri=[site-name]" by default ?

I also try to create alias with "drupal generate:site:alias --uri=[site-name]", that works:

drupal debug:site
 gcp
 * gcp.prod

But when I want use it, I get the not valid command name error:

drupal --target=gcp.prod cr all
[ERROR] Command "cr", is not a valid command name.

and

drupal --target=gcp.prod cr all --uri=[site-name]
Rebuilding cache(s), wait a moment please.
 [OK] Done clearing cache(s).

and the file "...console/sites/gcp.yml":

prod:
  type: local
  root: /home/sites/D8_commerce
  options:
    uri: gcp-d8-prod
#  arguments:
landsman commented 6 years ago

This is good idea!

I like using drush switch site command because it's simple: drush site-set blog and after them all drush comands will be executed for blog site not for default.

Please implement some command like this, based on some session. Thanks.

nvaken commented 6 years ago

Related: https://github.com/hechoendrupal/drupal-console/issues/3349