You are here

function drush_config_devel_export in Configuration development 8

Drush command callback.

File

drush/config_devel.drush.inc, line 77
Configuration development module drush integration.

Code

function drush_config_devel_export($extension) {

  // Determine the type of extension we're dealing with.
  $type = drush_config_devel_get_type($extension);
  if ($type) {

    // Get the config
    $config = drush_config_devel_get_config($type, $extension);

    // Process config
    if (isset($config['install'])) {
      drush_config_devel_process_config($config['install'], $type, $extension, InstallStorage::CONFIG_INSTALL_DIRECTORY);
    }

    // If we have any optional configuration, process that as well.
    if (isset($config['optional'])) {
      drush_config_devel_process_config($config['optional'], $type, $extension, InstallStorage::CONFIG_OPTIONAL_DIRECTORY);
    }
  }
  else {
    drush_set_error("Couldn't export configuration. The '{$extension}' extension is not enabled.");
  }
}