From 79dfb37fe34f4dcf860d01b67678e0a0733ec05f Mon Sep 17 00:00:00 2001 From: Samuel Georges Date: Thu, 25 Feb 2016 14:28:50 +1100 Subject: [PATCH] Adds october:util git pull command --- modules/system/console/OctoberUtil.php | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/modules/system/console/OctoberUtil.php b/modules/system/console/OctoberUtil.php index 464fcd4d7..8a3326912 100644 --- a/modules/system/console/OctoberUtil.php +++ b/modules/system/console/OctoberUtil.php @@ -228,4 +228,29 @@ class OctoberUtil extends Command // @todo } + + /** + * @todo This command is not compatible with Windows + */ + protected function utilGitPull() + { + foreach (File::directories(plugins_path()) as $authorDir) { + foreach (File::directories($authorDir) as $pluginDir) { + if (!File::isDirectory($pluginDir.'/.git')) continue; + $exec = 'cd ' . $pluginDir . ';'; + $exec .= 'git pull 2>&1;'; + echo 'Updating plugin: '. basename(dirname($pluginDir)) .'.'. basename($pluginDir) . PHP_EOL; + echo shell_exec($exec); + } + } + + foreach (File::directories(themes_path()) as $themeDir) { + if (!File::isDirectory($themeDir.'/.git')) continue; + $exec = 'cd ' . $themeDir . ';'; + $exec .= 'git pull 2>&1;'; + echo 'Updating theme: '. basename($themeDir) . PHP_EOL; + echo shell_exec($exec); + } + } + }