Drush vset a nested value

Public

If you are trying to vset a Drupal variable with Drush that is in a nested array it can be tricky. Here is a little trick that allows you to do that. In the example below, 'theme_itcomm_aurora_sub_settings' is the parent variable and 'aurora_livereload' is a nested variable. '9001' is the value I am setting.

Get raw version
bash
  1. php -r "print json_encode(array('drupal', 'theme_itcomm_aurora_sub_settings'));" | drush vset --yes --format=json aurora_livereload 9001