コード例 #1
0
ファイル: Checkout.php プロジェクト: shobcheye/sw-cli-tools
 /**
  * @param string $repo
  * @param string $branch
  * @param string $destination
  */
 public function checkout($repo, $branch, $destination)
 {
     $this->ioService->writeln("<info>Checkout out {$repo} to {$destination}</info>");
     $repo = escapeshellarg($repo);
     $branch = escapeshellarg($branch);
     $destination = escapeshellarg($destination);
     $this->gitUtil->run("clone --progress -b {$branch} {$repo} {$destination}");
 }
コード例 #2
0
ファイル: Checkout.php プロジェクト: 0x4/sw-cli-tools
 /**
  * @param string $branch
  * @param string $cloneUrl
  * @param string $absPath
  * @param string $pluginName
  */
 private function installPlugin($branch, $cloneUrl, $absPath, $pluginName)
 {
     $this->gitUtil->run("clone  --progress {$cloneUrl} {$absPath}");
     if ($branch) {
         $this->gitUtil->run("-C {$absPath} checkout {$branch}");
     }
     $branch = $branch ?: 'master';
     $this->ioService->writeln("Successfully checked out '{$branch}' for '{$pluginName}'\n");
 }
コード例 #3
0
 /**
  * @param string $branch
  * @param string $cloneUrl
  * @param string $absPath
  * @param string $pluginName
  */
 private function installPlugin($branch, $cloneUrl, $absPath, $pluginName)
 {
     $this->gitUtil->run("clone  --progress {$cloneUrl} {$absPath}");
     if ($branch) {
         // the CWD change is a fix for older versions of GIT which do not support the -C flag
         $cwd = getcwd();
         $this->utilities->changeDir($absPath);
         $this->gitUtil->run("checkout {$branch}");
         $this->utilities->changeDir($cwd);
     }
     $branch = $branch ?: 'master';
     $this->ioService->writeln("Successfully checked out '{$branch}' for '{$pluginName}'\n");
 }