Rework Update UI and fix banch

This commit is contained in:
johnnyq
2026-08-02 18:07:24 -04:00
parent a27019511e
commit 6b5be0f881
5 changed files with 208 additions and 89 deletions

View File

@@ -29,7 +29,7 @@ function printHelp() {
echo "Options:\n";
echo " --help Show this help message.\n";
echo " --update Perform a git pull to update the application.\n";
echo " --force_update Perform a git fetch and hard reset to origin/master.\n";
echo " --force_update Perform a git fetch and hard reset to the branch this install tracks.\n";
echo " --update_db Update the database structure to the latest version.\n";
echo "\nIf no options are provided, a standard update (git pull) is performed.\n";
}
@@ -82,9 +82,11 @@ if (count($options) === 0) {
// If "update" or "force_update" is requested
if (isset($options['update']) || isset($options['force_update'])) {
if (isset($options['force_update'])) {
// Perform a hard reset
// Perform a hard reset onto the tracked branch. This named origin/master outright
// until 26.08, which moved any install tracking another branch onto master.
$remote_ref = escapeshellarg("origin/" . getRepoBranch());
exec("git fetch --all 2>&1", $output, $return_var);
exec("git reset --hard origin/master 2>&1", $output2, $return_var2);
exec("git reset --hard $remote_ref 2>&1", $output2, $return_var2);
echo implode("\n", $output) . "\n" . implode("\n", $output2) . "\n";
} else {
// Perform a standard update (git pull)