-
Notifications
You must be signed in to change notification settings - Fork 1
/
auto-update
executable file
·64 lines (45 loc) · 1.22 KB
/
auto-update
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/bash
set -e
base_dir="$(dirname "$(readlink -f "$0")")"
source "$base_dir/global"
error() {
>&2 echo "Error:" "$@"
exit 1
}
check_git_status() {
local text="$1"
if [[ "$( git status --porcelain )" != "" ]]; then
#git gui & disown
#nohup git gui >/dev/null 2>&1 &
WINDOWID= zenity --error --title "DexPatcher Repo Updater" --text "$text" >/dev/null 2>&1
git gui
error "$text"
fi
}
auto_update() {
echo
echo
echo
echo " #################################"
echo " ## ##"
echo " ## DexPatcher Repo Updater ##"
echo " ## ##"
echo " #################################"
echo
echo
cd "$repo_dir"
check_git_status "Local DexPatcher repo is dirty."
"$base_dir/update-local-repo"
check_git_status "Local DexPatcher repo has changed."
echo
echo
echo " #############################"
echo " ## ##"
echo " ## NO CHANGES DETECTED ##"
echo " ## ##"
echo " #############################"
echo
echo
sleep 10
}
auto_update