From c9df31dd1ff2fb1e60d526240225123a3209acef Mon Sep 17 00:00:00 2001 From: hellcat <> Date: Mon, 30 Jun 2025 17:35:07 +0800 Subject: [PATCH] no message --- app/Http/Controllers/CronController.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/Http/Controllers/CronController.php b/app/Http/Controllers/CronController.php index 07bd9ac..54ce7b1 100755 --- a/app/Http/Controllers/CronController.php +++ b/app/Http/Controllers/CronController.php @@ -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";