Remove errors from `october:fresh` and indicate which demo files were moved

Follow-up work to fc9d6233a8.
This commit is contained in:
Ben Thomson 2020-09-14 08:09:00 +08:00 committed by GitHub
parent fc9d6233a8
commit 216b0d6004
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 9 deletions

View File

@ -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.');
}
}