Kirby\Cli\Command\Plugin\Uninstall::execute PHP Method

execute() protected method

protected execute ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output )
$input Symfony\Component\Console\Input\InputInterface
$output Symfony\Component\Console\Output\OutputInterface
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        if ($this->isInstalled() === false) {
            throw new RuntimeException('Invalid Kirby installation');
        }
        if ($plugin = $input->getArgument('name')) {
            $this->uninstall($plugin, $output);
        } else {
            $plugins = array_keys($this->kirby()->plugins());
            if (empty($plugins)) {
                $output->writeln('<info>There are no installed plugins</info>');
                $output->writeln('');
                return;
            }
            $helper = $this->getHelper('question');
            $question = new ChoiceQuestion('<info>Which plugin do you want to uninstall?</info>', $plugins, 0);
            $plugin = $helper->ask($input, $output, $question);
            // add some space
            $output->writeln('');
            $this->uninstall($plugin, $output);
        }
    }