diff --git a/CHANGELOG.md b/CHANGELOG.md
index d673e19d7..b6939cbff 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,6 @@
* **Build 11x** (2014-07-xx)
- Important! All references to *Email* have been changed to *Mail* and renaming may be required in plugins.
+ - Console command october:update now supports --core, --plugins and --force options.
* **Build 114** (2014-07-03)
- Created a new Record Finder form widget for searching related records.
diff --git a/modules/system/console/OctoberUpdate.php b/modules/system/console/OctoberUpdate.php
index d9a29ade1..8e733615e 100644
--- a/modules/system/console/OctoberUpdate.php
+++ b/modules/system/console/OctoberUpdate.php
@@ -34,26 +34,30 @@ class OctoberUpdate extends Command
{
$this->output->writeln('Updating October...');
$manager = UpdateManager::instance()->resetNotes();
+ $forceUpdate = $this->option('force');
+ $pluginsOnly = $this->option('plugins');
+ $coreOnly = $this->option('core');
- $updateList = $manager->requestUpdateList();
+ $updateList = $manager->requestUpdateList($forceUpdate);
$updates = (int)array_get($updateList, 'update', 0);
if ($updates == 0) {
$this->output->writeln('No new updates found');
return;
}
- else
+ else {
$this->output->writeln(sprintf('Found %s new %s!', $updates, Str::plural('update', $updates)));
+ }
- $coreHash = array_get($updateList, 'core.hash');
+ $coreHash = $pluginsOnly ? null : array_get($updateList, 'core.hash');
$coreBuild = array_get($updateList, 'core.build');
if ($coreHash) {
$this->output->writeln('Downloading application files');
$manager->downloadCore($coreHash);
}
-
- $plugins = array_get($updateList, 'plugins');
+
+ $plugins = $coreOnly ? [] : array_get($updateList, 'plugins');
foreach ($plugins as $code => $plugin) {
$pluginName = array_get($plugin, 'name');
$pluginHash = array_get($plugin, 'hash');
@@ -94,7 +98,11 @@ class OctoberUpdate extends Command
*/
protected function getOptions()
{
- return [];
+ return [
+ ['force', null, InputOption::VALUE_NONE, 'Force updates.'],
+ ['core', null, InputOption::VALUE_NONE, 'Update core application files only.'],
+ ['plugins', null, InputOption::VALUE_NONE, 'Update plugin files only.'],
+ ];
}
}