From 7a3bcbf08630601dcb7e1f9c7d2ba96609027d99 Mon Sep 17 00:00:00 2001 From: Babak Alizadeh Date: Fri, 7 Mar 2025 10:13:55 +0000 Subject: [PATCH] support of change beranch in updater --- hesabixCore/src/Command/UpdateSoftwareCommand.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hesabixCore/src/Command/UpdateSoftwareCommand.php b/hesabixCore/src/Command/UpdateSoftwareCommand.php index 92b36c1..6525287 100644 --- a/hesabixCore/src/Command/UpdateSoftwareCommand.php +++ b/hesabixCore/src/Command/UpdateSoftwareCommand.php @@ -84,7 +84,7 @@ class UpdateSoftwareCommand extends Command if ($this->isUpToDate()) { $this->writeOutput($output, 'The software is already up to date with the remote repository.'); $this->logger->info('No update needed, software is up to date.'); - $state['log'] .= "No update needed, software is up to date.\n"; // اضافه کردن مستقیم به لاگ + $state['log'] .= "No update needed, software is up to date.\n"; $state['completedSteps'] = ['post_update_test']; $this->saveState($uuid, $state, $output, 'No update needed'); $lock->release(); @@ -124,6 +124,10 @@ class UpdateSoftwareCommand extends Command } if (!in_array('git_pull', $state['completedSteps'])) { + $this->writeOutput($output, 'Setting up tracking for master branch...'); + // تنظیم ردیابی شاخه master به origin/master + $this->runProcess(['git', 'branch', '--set-upstream-to=origin/master', 'master'], $this->rootDir, $output, 1); + $this->writeOutput($output, 'Pulling latest changes from GitHub...'); $gitHeadBefore = $this->getCurrentGitHead(); $this->runProcess(['git', 'pull'], $this->rootDir, $output, 3);