-
Notifications
You must be signed in to change notification settings - Fork 0
/
g
executable file
·84 lines (62 loc) · 1.01 KB
/
g
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
#!/bin/bash
function _status {
echo
echo -e "\e[0;33m> git status\e[0m"
echo
git status
echo
}
function _pull {
echo
echo -e "\e[0;33m> git pull\e[0m"
echo
git pull
echo
}
function _send {
_status
if [ -z "`git status --porcelain`" ]
then
echo -e "\e[0;31m Nothing to commit.\e[0m"
echo
exit
fi
echo -e "\e[0;32m Going to ADD all, COMMIT and PUSH.\e[0m"
echo -e "\e[0;32m Enter commit message (leave blank to abort).\e[0m"
echo
echo -n -e "\e[1;36m [msg]: \e[0m"
read msg
echo
if [ -z "$msg" ]
then
echo -e "\e[0;31m Aborted.\e[0m"
echo
exit
fi
echo -e "\e[0;33m> git add --all\e[0m"
echo
git add --all
echo
echo -e "\e[0;33m> git commit -m \"$msg\"\e[0m"
echo
git commit -m "$msg"
echo
echo -e "\e[0;33m> git push\e[0m"
echo
git push
echo
}
case $1 in
"check" | "status")
_status
;;
"pull")
_pull
;;
"send" | "push")
_send
;;
*)
echo -e "\n\e[0;31m Invalid ACTION '$1', use one of {check, pull, send} !\e[0m\n";
;;
esac