protected function execute(InputInterface $input, OutputInterface $output)
 {
     $validate = new Validate();
     $filesystem = new Filesystem();
     $project = $input->getArgument('project');
     $branch = $input->getOption('branch');
     $clone = $input->getOption('clone');
     $storage = $input->getOption('storage');
     if (!empty($project) && !empty($clone)) {
         throw new \InvalidArgumentException('Cannot use both the project argument and the --clone option');
     }
     if (!empty($project)) {
         $cloneUrl = sprintf('https://github.com/%s.git', $project);
     } elseif (!empty($clone)) {
         $cloneUrl = $clone;
     } else {
         throw new \RuntimeException('Must use the project argument or --clone option');
     }
     $filesystem->mkdir($storage);
     $storageDir = realpath($validate->directory($storage));
     $process = new Process(sprintf('git clone --depth 1 --branch %s %s', $branch, $cloneUrl), $storageDir);
     $this->execute->mustRun($process);
     $dumper = new EnvDumper();
     $dumper->dump(['EXTRA_PLUGINS_DIR' => $storageDir], $this->envFile);
 }
Пример #2
0
 public function testNoDump()
 {
     $toFile = $this->tempDir . '/.env';
     $dumper = new EnvDumper();
     $dumper->dump([], $toFile);
     $this->assertFileNotExists($toFile);
 }
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $this->factory->addInstallers($this->installers);
     $this->install->runInstallation($this->installers);
     $envDumper = new EnvDumper();
     $envDumper->dump($this->installers->mergeEnv(), $this->envFile);
     // Progress bar does not end with a newline.
     $output->writeln('');
 }