Add Force Update Button

This commit is contained in:
johnnyq 2024-06-07 20:36:18 -04:00
parent f1b28a6f14
commit 86cd618b03
2 changed files with 7 additions and 6 deletions

View File

@ -34,6 +34,7 @@ $git_log = shell_exec("git log $repo_branch..origin/$repo_branch --pretty=format
<?php if (!empty($git_log)) { ?>
<a class="btn btn-primary btn-lg my-4" href="post.php?update"><i class="fas fa-fw fa-4x fa-download mb-1"></i><h5>Update App</h5></a>
<a class="btn btn-primary" href="post.php?update&force_update=1"><i class="fas fa-fw fa-4x fa-download mb-1"></i><h5>FORCE Update App</h5></a>
<hr>
<?php } else {

View File

@ -762,14 +762,14 @@ if (isset($_GET['update'])) {
validateAdminRole();
exec("git pull");
//FORCE UPDATE FUNCTION (Will be added later as a checkbox)
//git fetch downloads the latest from remote without trying to merge or rebase anything. Then the git reset resets the master branch to what you just fetched. The --hard option changes all the files in your working tree to match the files in origin/master
//exec("git fetch --all");
//exec("git reset --hard origin/master");
if(isset($_GET['force_update'] == 1)) {
exec("git fetch --all");
exec("git reset --hard origin/master");
} else {
exec("git pull");
}
//header("Location: post.php?update_db");