-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathg
executable file
·96 lines (71 loc) · 968 Bytes
/
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
85
86
87
88
89
90
91
92
93
94
95
96
#!/bin/bash
function _status {
echo
echo -e " git status"
echo
git status
echo
}
function _pull {
echo
echo -e " git pull"
echo
git pull
echo
}
function _log {
echo
echo -e " git log -1"
git log -1
echo
}
function _send {
_status
if [ -z "`git status --porcelain`" ]
then
echo -e " Nothing to commit."
echo
exit
fi
echo -e " Going to ADD all, COMMIT and PUSH."
echo -e " Enter commit message (leave blank to abort)."
echo
echo -n -e " [msg]: "
read msg
echo
if [ -z "$msg" ]
then
echo -e " Aborted."
echo
exit
fi
echo -e " git add --all"
echo
git add --all
echo
echo -e " git commit -m \"$msg\""
echo
git commit -m "$msg"
echo
echo -e " git push"
echo
git push
echo
}
case $1 in
"status")
_status
;;
"pull")
_pull
;;
"log")
_log
;;
"send" | "push")
_send
;;
*)
echo -e "\n Invalid ACTION '$1', use one of {check, pull, send} !\n";
;;
esac