-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathAutoPUSH.sh
83 lines (71 loc) · 2.02 KB
/
AutoPUSH.sh
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
#!/bin/sh
red=$'\e[1;31m'
grn=$'\e[1;32m'
yel=$'\e[1;33m'
mag=$'\e[1;35m'
cyn=$'\e[1;36m'
nc=$'\e[0m'
lgrn=$'\e[92m'
blink=$'\e[5m'
echo
echo +++ Brought to you by: ${cyn}HENRY LE${nc} +++
echo -e +++ Version: ${mag}0${nc}, Date: ${mag}Jun, 2020${nc} +++
echo =============================
startTime=$(date)
SECONDS=0
echo
printf "Local Time: %s\n" "${mag}$startTime${nc}"
echo
echo "--------------------------"
while true
do
echo
echo -e "${red}${bold}WARNING ${nBold}${nc}:: ${yel}Data may be lost${nc} if push \033[4mincorrectly!${nc}"
read -r -p "Are you ${cyn}sure${nc} you want to push (y/n)?${nc} " userinput
case $userinput in
[yY][eE][sS]|[yY])
echo Begin ${red}Git Pushing${nc}. Please wait...
echo "--------------------------"
echo ${yel}Adding files...${nc} & git add .
echo "--------------------------"
echo "${yel}Preparing to push...${nc}"
echo "--------------------------"
echo Please ${red}input message${nc} "(${red}NO ${cyn}double quote${nc} needed)"
read message
printf "Adding message :: ${yel}\"$message\"${nc}to git package\n" & git commit -m "$message"
echo "--------------------------"
echo Message: \"${yel}$message${nc}\" - ${grn}sucessfully added!${nc}
echo "--------------------------"
echo ${yel}UPLOADING FILES${nc} ... Please wait ...
echo "--------------------------"
git push
echo
echo
break
;;
[nN][oO]|[nN])
echo
echo "--------------------------"
echo
echo "${yel}NOTHING was pushed!${nc}"
echo
echo "--------------------------"
break
;;
*)
echo "--------------------------"
echo "${red}In Valid Input ... ${nc}"
echo "${cyn}Please try again ... ${nc}"
echo "--------------------------"
;;
esac
done
echo
echo ===== ${cyn}THANK YOU${nc} for using my Scripts! - ${yel}HENRY LE${grn} ${grn}"(06/2020)"${nc} =====
finishTime=$(date)
printf " Local Time :: %s\n" "${mag}$finishTime${nc}"
echo " Script Total Time :: ${mag}$SECONDS${nc} second(s)"
echo
echo " Press ${yel}Enter to Exit...${nc}"
echo
read