/** * @param string $command * @param array $arguments * @return string */ public function buildCommand($command, array $arguments = []) { array_unshift($arguments, $command); $bin = $this->config->getGitBin(); $builder = ProcessBuilder::create($arguments); $builder->setPrefix($bin); $cmd = $builder->getProcess()->getCommandLine(); $cmd = 'cd ' . $this->getRepositoryPath() . ' && ' . $cmd; return $cmd; }
/** * @return RepositoryList */ public function buildRepositoryModelList() { $path = $this->config->getMainDir(); $provider = new GitProvider($this->config, $path); $provider->setLogger($this->getLogger()); $projectModel = new RepositoryModel(RepositoryModel::TYPE_ROOT, $path, $path, $provider); $vendors = []; foreach ($this->config->getVendorDirs() as $path) { $provider = new GitProvider($this->config, $path); $provider->setLogger($this->getLogger()); $model = new RepositoryModel(RepositoryModel::TYPE_VENDOR, $this->config->getMainDir(), $path, $provider); $vendors[] = $model; } $result = new RepositoryList($projectModel, $vendors); return $result; }