From e15b1c1f408b427d126fe9d6fe2623f2f3b4c627 Mon Sep 17 00:00:00 2001 From: Surillya Date: Fri, 20 Jun 2025 18:17:13 +0200 Subject: [PATCH] Hopefully fixed update --- run_update.php | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/run_update.php b/run_update.php index efd2083..e17f908 100644 --- a/run_update.php +++ b/run_update.php @@ -1,13 +1,24 @@ &1"); + $output[] = shell_exec("git -C $path reset --hard origin/main 2>&1"); + + $output[] = shell_exec("git -C $path clean -fd 2>&1"); + + return implode("\n", $output); +} if ($mode === 'git') { - $output = shell_exec("git -C /usr/thos pull 2>&1"); - echo "✅ Git update applied:\n$output"; + echo "🔄 Forcing full git reset and update...\n\n"; + echo forceGitUpdate($repoPath); } elseif ($mode === 'curl') { - // Placeholder for future upgrade logic - $output = shell_exec("curl -s https://your.url/thos-update.sh | sudo bash 2>&1"); - echo "🔧 Installer run:\n$output"; + echo "🔧 Running installer...\n\n"; + echo shell_exec("curl -s https://surillya.com/thos/thos.sh | sudo bash 2>&1"); } else { http_response_code(400); echo "❌ Unknown update mode";