(eg: Winter.Blog)} {--f|force : Force the operation to run and ignore production warnings and confirmation questions.}'; /** * @var string The console command description. */ protected $description = 'Removes and re-adds an existing plugin.'; /** * Execute the console command. */ public function handle(): int { $pluginName = $this->getPluginIdentifier(); if (!$this->confirmWithInput( "This will completely remove and reinstall $pluginName. This may result in potential data loss.", $pluginName )) { return 1; } // Set the UpdateManager output stream to the CLI $manager = UpdateManager::instance()->setNotesOutput($this->output); // Rollback the plugin $manager->rollbackPlugin($pluginName); // Reinstall the plugin $this->output->writeln('Reinstalling plugin...'); $manager->updatePlugin($pluginName); return 0; } }