Ejemplo n.º 1
0
 /**
  * @inheritdoc
  */
 protected function initialize(InputInterface $input, OutputInterface $output)
 {
     if (empty(Config::get())) {
         $this->cwd = getcwd();
         /** @var QuestionHelper $helper */
         $helper = $this->getHelper('question');
         $output->writeln("<comment>Current directory: {$this->cwd}");
         $question = new ConfirmationQuestion("<info>There isn't a project here, create one? [Y,n] </info>");
         if ($helper->ask($input, $output, $question)) {
             Config::set('alias-group', basename($this->cwd));
             Config::set('name', basename($this->cwd));
             Config::set('path', $this->cwd);
             if (!Config::write($this->cwd)) {
                 throw new \Exception('There was an error writing the platform configuration.');
             }
         } else {
             exit(1);
         }
     }
     parent::initialize($input, $output);
 }