Пример #1
0
 /**
  * @inheritdoc
  */
 protected function initialize(InputInterface $input, OutputInterface $output)
 {
     parent::initialize($input, $output);
     $behatYmls = [];
     foreach ($this->discoverBehatYml() as $file) {
         /* @var $file \Symfony\Component\Finder\SplFileInfo */
         $behatYmls[] = $file->getRealPath();
     }
     if (count($behatYmls) == 0) {
         $output->writeln('Unable to find behat.yml in project');
         exit(1);
     }
     $helper = $this->getHelper('question');
     $question = new ChoiceQuestion('Select the Behat configuration to use', $behatYmls, 0);
     $this->behatLocation = $helper->ask($input, $output, $question);
     $output->writeln("<comment>Using behat.yml: {$this->behatLocation}");
 }
Пример #2
0
 /**
  * @param \Symfony\Component\Console\Input\InputInterface $input
  * @param \Symfony\Component\Console\Output\OutputInterface $output
  *
  * @throws \Exception
  */
 protected function initialize(InputInterface $input, OutputInterface $output)
 {
     parent::initialize($input, $output);
     if (!Docker::exists()) {
         $this->stdOut->writeln("<error>Cannot find docker command</error>");
         exit(1);
     }
     if (!Compose::exists()) {
         $this->stdOut->writeln("<error>Cannot find docker-compose command</error>");
         exit(1);
     }
     // For Mac OS X we need to ensure a Docker VM is running.
     if (!Docker::native()) {
         $this->validateNonNative();
     } else {
         $this->validateNative();
     }
 }
Пример #3
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);
 }