Last active
July 14, 2017 21:05
-
-
Save wxactly/34afe914c6f1089244e7cadaf0d632f4 to your computer and use it in GitHub Desktop.
Robo task for updating Drupal 8 module config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class RoboFile extends \Robo\Tasks | |
{ | |
/** | |
* Update site config by importing from a module's config directory. | |
* | |
* @param string $module Module name | |
* @param array $opts | |
* | |
* @return \Robo\Result | |
*/ | |
public function configUpdate( $module, $opts = [ 'yes|y' => false ] ) { | |
$get_module_path = 'drush pmi ' . $module . ' --format=csv --fields=path'; | |
$get_source = '$(' . $get_module_path . ')/config/install'; | |
$y = $opts['yes'] ? ' --yes' : ''; | |
return $this->taskExec( 'drush cim' . $y . ' --partial --source=' . $get_source ) | |
->dir( 'web' ) | |
->run(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage: