diff --git a/valkyrie.drush.inc b/valkyrie.drush.inc index 2096e03..a4e6415 100644 --- a/valkyrie.drush.inc +++ b/valkyrie.drush.inc @@ -121,7 +121,11 @@ function valkyrie_drush_command() { 'aliases' => array('vup'), 'bootstrap' => DRUSH_BOOTSTRAP_DRUSH, // No bootstrap at all. ); - + $items['valkyrie-upgrade'] = array( + 'description' => 'Upgrade global Valkyrie extension and all of the submodules.', + 'aliases' => array('vug'), + 'bootstrap' => DRUSH_BOOTSTRAP_DRUSH, // No bootstrap at all. + ); $items['valkyrie-platform-add'] = array( 'description' => 'Register an existing platform with Valkyrie', 'arguments' => array( @@ -346,6 +350,20 @@ function drush_valkyrie_update() { } } } +function drush_valkyrie_upgrade() { + $current_path = getcwd(); + $src = dirname(__FILE__); + if($src != $current_path) { + drush_print('You need to be in (~/.drush/valkyrie) to do this'); + } + else { + drush_print('Checking for updates...'); + drush_shell_proc_open('git pull'); + drush_print('Checking submodule updates...'); + drush_shell_proc_open('git submodule update --init --recursive'); + drush_log('Upgrade Finished', 'ok'); + } +} /** * Command callback for the 'valkyrie-snapshot' command.