/** * @inheritDoc */ protected function execute(InputInterface $input, OutputInterface $output) { $path = $input->getArgument('path'); $template = $input->getArgument('template'); $force = $input->getOption('force'); $completeScaffold = $input->getOption('all'); $io = new ConsoleIO($input, $output, $this->getHelperSet()); $operation = new NewSite($this->getTemplatesPath()); $operation->newSite($path, $template, $force, $completeScaffold); $this->successMessage($io, $path); }
protected function execute(InputInterface $input, OutputInterface $output) { $path = $input->getArgument('path'); $template = $input->getArgument('template'); $force = $input->getOption('force'); $completeScaffold = $input->getOption('all'); $io = new ConsoleIO($input, $output, $this->getHelperSet()); $app = new SpressCLI($io); $operation = new NewSite($app['spress.paths']['templates']); $operation->newSite($path, $template, $force, $completeScaffold); $io->write(sprintf('<comment>New site created at %s.</comment>', $path)); if ('./' == $path) { $io->write('<comment>Edit composer.json file to add your theme data and plugins required.</comment>'); } else { $io->write(sprintf('<comment>Go to %s folder and edit composer.json file to add your theme data and plugins required.</comment>', $path)); } }
/** * @expectedException \InvalidArgumentException */ public function testNewSiteTemplateNotExists() { $operation = new NewSite($this->templatePath); $operation->newSite($this->tmpDir, 'template-not-exisits'); }