backdrop-contrib / backdrop-drush-extension

A set of commands and boot class for Drush and Backdrop CMS.
GNU General Public License v2.0
13 stars 18 forks source link

Get drush `vget`/`vset`/`vdel` and `cget`/`cset`/`cdel` working with Backdrop #196

Closed klonos closed 4 years ago

klonos commented 5 years ago

...I am trying to automate setting up my local, and ended up doing this:

cd docroot/files/config_*/active
jq --indent 4 '.error_level = "all" | .preprocess_css = 0 | .preprocess_js = 0' system.core.json > system.tmp.$$.json && mv system.tmp.$$.json system.core.json
jq --indent 4 '.position_fixed = 1' admin_bar.settings.json > admin.tmp.$$.json && mv admin.tmp.$$.json admin_bar.settings.json

...whereas I would like to be able to do something like this instead:

drush cset system.core error_level "all"
drush cset system.core preprocess_css 0
drush cset system.core preprocess_js 0
drush cset admin_ber.settings position_fixed 1

In Backdrop, we may also need sget/sset/sdel for state_get(), state_set(), state_del().


PR: https://github.com/backdrop-contrib/drush/pull/212

TheMetMan commented 4 years ago

I would like to be able to put the site into maintenance mode from scripts using Drush as per Drupal 7

drush vset maintenance_mode 1

serundeputy commented 4 years ago

I did a little digging on this and setting maintenance mode in backdrop is a state_set so we'd need the drush state-set wrapper to get this working.

serundeputy commented 4 years ago

Added state-set, state-get, config-set, and config-get in https://github.com/backdrop-contrib/drush/pull/212

@TheMetMan you can now put the site in maintenance_mode with drush:

drush state-set maintenance_mode 1

This is in backdrop-drush 1.x-1.x and will ship with drush 1.2.0

TheMetMan commented 4 years ago

Well what service @serundeputy!!! Much obliged.