sync repo by using a page button

This commit is contained in:
aaronchen2k
2020-01-13 11:09:37 +08:00
parent b6c7f38e1a
commit 91e680de2f
5 changed files with 42 additions and 10 deletions
+9 -5
View File
@@ -140,18 +140,22 @@ class gitModel extends model
/**
* Pull codes from remote repo.
*
* @access public
* @return void
* @param $repoRoot
*/
public function pull()
public function pull($repo)
{
chdir($this->repoRoot);
if (!empty($repo)) {
$repoRoot = $repo->path;
$this->setClient($repo);
} else {
$repoRoot = $this->repoRoot;
}
chdir($repoRoot);
// exec('sudo -u aaron whoami', $output, $return);
$cmd = "{$this->client} pull 2>&1";
exec($cmd, $output, $return);
$this->printLog("{$cmd}, {$output}, {$return}");
}
/**