From 216b0d6004ec193263bdf2f535220d693f251508 Mon Sep 17 00:00:00 2001 From: Ben Thomson Date: Mon, 14 Sep 2020 08:09:00 +0800 Subject: [PATCH] Remove errors from `october:fresh` and indicate which demo files were moved Follow-up work to fc9d6233a8da738b5b8bbdf2fb7e6fd67da12b66. --- modules/system/console/OctoberFresh.php | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/modules/system/console/OctoberFresh.php b/modules/system/console/OctoberFresh.php index 627eab62e..a10283268 100644 --- a/modules/system/console/OctoberFresh.php +++ b/modules/system/console/OctoberFresh.php @@ -35,25 +35,30 @@ class OctoberFresh extends Command if (!$this->confirmToProceed('Are you sure?')) { return; } + + $themeRemoved = false; + $pluginRemoved = false; $demoThemePath = themes_path().'/demo'; if (File::exists($demoThemePath)) { File::deleteDirectory($demoThemePath); - - $this->info('Demo theme has been removed! Enjoy a fresh start.'); - } - else { - $this->error('Demo theme is already removed.'); + $themeRemoved = true; } $demoPluginPath = plugins_path().'/october/demo'; if (File::exists($demoPluginPath)) { Artisan::call('plugin:remove', ['name' => 'October.Demo', '--force' => true]); - - $this->info('Demo plugin has been removed! Enjoy a fresh start.'); + $pluginRemoved = true; } - else { - $this->error('Demo plugin is already removed.'); + + if ($themeRemoved && $pluginRemoved) { + $this->info('Demo theme and plugin have been removed! Enjoy a fresh start.'); + } elseif ($themeRemoved) { + $this->info('Demo theme has been removed! Enjoy a fresh start.'); + } elseif ($pluginRemoved) { + $this->info('Demo plugin has been removed! Enjoy a fresh start.'); + } else { + $this->info('Demo theme and plugin have already been removed.'); } }