-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdate.sh
More file actions
executable file
·33 lines (24 loc) · 898 Bytes
/
update.sh
File metadata and controls
executable file
·33 lines (24 loc) · 898 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
echo "Hyper Library Dynamic Integration Technology";
echo "HLEngine updates 2020";
gif-for-cli "HL_Flags/updating_HLEngine.gif"
set -e
local_branch=$(git rev-parse --symbolic-full-name --abbrev-ref HEAD)
remote_branch=$(git rev-parse --abbrev-ref --symbolic-full-name @{u})
remote=$(git config branch.$local_branch.remote)
echo "Fetching from $remote..."
git fetch $remote
if git merge-base --is-ancestor $remote_branch HEAD; then
echo 'Already up-to-date'
exit 0
fi
if git merge-base --is-ancestor HEAD $remote_branch; then
echo 'Fast-forward possible. Merging...'
git merge --ff-only --stat $remote_branch
echo "Reboot HLEngine to reflect updates";
else
echo 'Fast-forward not possible. Rebasing...'
git rebase --preserve-merges --stat $remote_branch
echo "Couldn't Update";
echo "Please Download HLEngine 2020 newer version Manually";
fi