public function fire()
 {
     $this->comment('Updating documentation...');
     $this->git->setRepository(public_path() . '/Documentation');
     $this->git->pull('origin', 'master');
     $this->generator->generate();
     $this->call('cache:clear');
     $this->info('Documentation updated!');
 }
Example #2
0
 public function testPull()
 {
     $git = new Git();
     $git->init($this->directory);
     $git->setRepository($this->directory);
     $git->remote->add('origin', 'https://github.com/kzykhys/Text.git');
     $git->pull('origin', 'master');
     $this->assertFileExists($this->directory . '/README.md');
 }
 /**
  * Return the path to the checked out repository for the supplied
  * manual and version.
  *
  * @param string $manual
  * @param string $version
  * @return string
  */
 private function getStoragePath($manual, $version)
 {
     $storagePath = storage_path('codex/' . $manual . '/' . $version);
     if (!file_exists($storagePath)) {
         $this->files->copyDirectory($this->storagePath . '/' . $manual, $storagePath, 0);
         $this->git->setRepository($storagePath);
         $this->git->checkout($version);
     } else {
         $this->cache->remember("{$manual}.{$version}.checkout", 10, function () use($version, $storagePath) {
             $this->git->setRepository($storagePath);
             $this->git->pull('origin', $version);
             return true;
         });
     }
     return $storagePath;
 }
Example #4
0
 public function testPullWithInvalidRepoDirectoryPathThrowsException()
 {
     $binary = '/usr/bin/git';
     $git = new Git($binary, new Process());
     $this->setExpectedException('\\PhpGit\\Exception\\RepoNotFoundException');
     $git->pull('mfs://repos/invalid-repo');
 }
Example #5
0
 /**
  * Pulls from the default remote repository.
  */
 public function pull()
 {
     $this->git->pull($this->path);
 }