-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsync-git
More file actions
executable file
·86 lines (63 loc) · 1.45 KB
/
sync-git
File metadata and controls
executable file
·86 lines (63 loc) · 1.45 KB
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#!/bin/bash -e
WITH_PUSH="yes"
while getopts ":r" opt; do
case $opt in
r)
WITH_PUSH=""
echo "-r was triggered!" >&2
;;
\?)
echo "Invalid option: -$OPTARG" >&2
;;
esac
done
COLOR_ACCENT='\033[1;34m'
COLOR_ERROR='\033[0;31m'
COLOR_STATUS='\033[0;37m'
COLOR_NONE='\033[0m' # No Color
OK_TEXT="${COLOR_OK}ok${COLOR_NONE}"
PROJECT_DIR=$PWD
function git-sync {
printf "\n${COLOR_ACCENT}$PWD${COLOR_NONE}\n"
printf " ${COLOR_STATUS}git status:${COLOR_NONE}\n "
OUTPUT="$(git status --short)"
if [ "$OUTPUT" ]
then
printf "${COLOR_ERROR}dirty git directory${COLOR_NONE}\n"
git status
exit 1
fi
printf "ok\n"
#printf "$OK_TEXT\n"
printf " ${COLOR_STATUS}git fetch --all:${COLOR_NONE}\n "
git fetch --all
printf " ${COLOR_STATUS}git checkout master --quiet:${COLOR_NONE}\n "
git checkout master --quiet
printf "ok\n"
#printf "$OK_TEXT\n"
printf " ${COLOR_STATUS}git merge --ff-only:${COLOR_NONE}\n "
git merge --ff-only
if [ $WITH_PUSH ]
then
printf " ${COLOR_STATUS}git push:${COLOR_NONE}\n "
git push
fi
}
cd ../bindscript
git-sync
cd ../browser-headsup
git-sync
cd ../facts-db
git-sync
cd ../conform
git-sync
cd ../appkernel
git-sync
cd ../apptoolkit
git-sync
cd ../model-driver
git-sync
cd ../material-desktop
git-sync
cd "$PROJECT_DIR"
git-sync