/** * @param Repository $repository * * @return \GitWrapper\GitWorkingCopy */ public function checkoutGitHubPages(Repository $repository) { $isProjectPage = !preg_match('#\\.github\\.io$#', $repository->getPackageName()); $branch = $isProjectPage ? 'gh-pages' : 'master'; $directory = $this->getGitHubPagesDirectory($repository); $git = $repository->getGitWrapper()->workingCopy($directory); if (!$git->isCloned()) { $git->clone('git@github.com:' . $repository . '.git'); } $git->checkout($branch)->pull(); return $git; }
/** * @param TargetInterface $target * * @return array * * @see http://moquet.net/blog/distributing-php-cli/ */ public function build(TargetInterface $target) { $manifest = []; $versions = $this->repository->getPackageVersions(); foreach ($versions as $version) { $filepath = $target->downloadPhar($this->repository, $version); if (!$filepath) { continue; } $manifest[] = ['name' => basename($filepath), 'sha1' => sha1_file($filepath), 'url' => $target->getPharUrl($this->repository, $version), 'version' => $version]; } return $manifest; }