function run($repoUri, $target) { if (file_exists($target)) { $this->logAction('hg:pull', $repoUri); Helper::system('hg', '-R', $target, 'pull', '-u'); } else { $this->logAction('hg:clone', $repoUri); Helper::system('hg', 'clone', $repoUri, $target); } }
function run($repoUri, $target) { if (file_exists($target)) { $this->logAction('git:pull', $repoUri); Helper::system('git', '--git-dir', $target . DIRECTORY_SEPARATOR . '.git', 'remote', 'update', '--prune'); Helper::system('git', '--git-dir', $target . DIRECTORY_SEPARATOR . '.git', 'pull', '--all'); } else { $this->logAction('git:clone', $repoUri); Helper::system('git', 'clone', $repoUri, $target); } }