no message

This commit is contained in:
hellcat 2025-06-30 17:35:07 +08:00
parent abb99a466f
commit c9df31dd1f

View File

@ -175,12 +175,12 @@ class CronController
return $str;
}
private function runCommand($command) {
private function runCommand($command, $show_error = 1) {
$output = [];
$returnVar = 0;
exec($command, $output, $returnVar);
if ($returnVar !== 0 && $this->aArticle['show_error'] == 1) {
if ($returnVar !== 0 && $this->aArticle['show_error'] == 1 && $show_error == 1) {
$aMsg = [
"命令" => $command,
@ -217,8 +217,8 @@ class CronController
$this->runCommand("git remote add origin \"{$this->sProjectUrl}\"");
// 立即拉取覆盖一次
$this->runCommand("git fetch origin");
// $this->runCommand("git reset --hard origin/main");
$this->runCommand("git fetch origin", 0);
$this->runCommand("git reset --hard origin/main", 0);
echo "操作完成:以初始化仓库[".$this->aArticle['id']."]。\n";