Example #1
0
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $packageName = $input->getArgument('package');
     $dialog = $this->getHelperSet()->get('dialog');
     $this->template->open($this->getPackageZipUrl($packageName));
     $output->writeln('Enter Template variables (Press enter for default):');
     $this->template->setValues($this->prompts->getValues($this->template->getPromptNames(), $output, $dialog));
     $valuesDisplay = "Use These Variables:\n";
     foreach ($this->template->getValues() as $key => $value) {
         $valuesDisplay .= "  <info>{$key}</info>: {$value}\n";
     }
     $valuesDisplay .= "Confirm? <comment>(Y/n)</comment>:";
     if ($dialog->askConfirmation($output, $valuesDisplay, 'y')) {
         $this->template->putInto(getcwd());
         $output->writeln('Done');
     } else {
         $output->writeln('<error>Aborted</error>');
     }
 }