Gumdrop\Commands\Generate::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)
    {
        $source = $input->getArgument('source');
        $destination = $input->getArgument('destination');
        $Application = new \Gumdrop\Application();
        $Application->setSourceLocation($source);
        $Application->setDestinationLocation($destination);
        $Application->setMarkdownParser(new \dflydev\markdown\MarkdownExtraParser());
        $Application->setTwigEnvironments(new \Gumdrop\TwigEnvironments($Application));
        $Application->setFileHandler(new \Gumdrop\FileHandler($Application));
        $Application->setTwigFileHandler(new \Gumdrop\TwigFileHandler($Application));
        $Application->setEngine(new \Gumdrop\Engine($Application));
        try {
            $Application->getEngine()->run();
            $output->writeln('<fg=green>Gumdrop converted your MarkDown files to ' . realpath($Application->getDestinationLocation()) . '</fg=green>');
        } catch (\Exception $e) {
            $output->writeln('<fg=red>Gumdrop could not generate your site for the following reason:</fg=red>');
            $output->writeln('<fg=black;bg=red>' . $e->getMessage() . '</fg=black;bg=red>');
        }
    }