mirror of
https://github.com/itflow-org/itflow
synced 2026-03-11 00:04:50 +00:00
Add Force Update Button
This commit is contained in:
@@ -34,6 +34,7 @@ $git_log = shell_exec("git log $repo_branch..origin/$repo_branch --pretty=format
|
|||||||
|
|
||||||
<?php if (!empty($git_log)) { ?>
|
<?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 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>
|
<hr>
|
||||||
|
|
||||||
<?php } else {
|
<?php } else {
|
||||||
|
|||||||
@@ -762,14 +762,14 @@ if (isset($_GET['update'])) {
|
|||||||
|
|
||||||
validateAdminRole();
|
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
|
//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");
|
if(isset($_GET['force_update'] == 1)) {
|
||||||
//exec("git reset --hard origin/master");
|
exec("git fetch --all");
|
||||||
|
exec("git reset --hard origin/master");
|
||||||
|
} else {
|
||||||
|
exec("git pull");
|
||||||
|
}
|
||||||
//header("Location: post.php?update_db");
|
//header("Location: post.php?update_db");
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user