Exemplo n.º 1
0
 protected function cloneGitProject($projectName, ProjectConfiguration $config, OutputInterface $output)
 {
     if (is_dir($config->getLocalGitRepositoryDir())) {
         $output->writeln(sprintf('<comment>A project with that name "<info>%s</info>" already exists</comment>', $projectName));
         return;
     }
     $output->writeln(sprintf('<comment>Create git project "<info>%s</info>" in "<info>%s</info>"</comment>', $projectName, $config->getLocalGitRepositoryDir()));
     $this->getExec()->run(strtr('git clone %git_repository_url% %local_git_repository_dir% && cd %local_git_repository_dir% && git checkout %git_target_branch%', ['%local_git_repository_dir%' => $config->getLocalGitRepositoryDir(), '%git_repository_url%' => $config->getGitRepositoryUrl(), '%git_target_branch%' => $config->getGitTargetBranch()]), $output);
 }