-
Notifications
You must be signed in to change notification settings - Fork 15
/
smart-push
executable file
·36 lines (31 loc) · 972 Bytes
/
smart-push
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
#!/bin/bash
#Black 0;30 Dark Gray 1;30
#Red 0;31 Light Red 1;31
#Green 0;32 Light Green 1;32
#Brown/Orange 0;33 Yellow 1;33
#Blue 0;34 Light Blue 1;34
#Purple 0;35 Light Purple 1;35
#Cyan 0;36 Light Cyan 1;36
#Light Gray 0;37 White 1;37
ERROR_COLOR='\033[1;31m'
PRIMARY_COLOR='\033[1;34m'
COUNT_COLOR='\033[0;33m'
ACCENT_COLOR='\033[1;32m'
SUCCESS_COLOR='\033[1;33m'
NO_COLOR='\033[0m'
((i+=1));
printf "${PRIMARY_COLOR}Trying push: ${COUNT_COLOR}${PWD##*/} ${i}${ACCENT_COLOR}\n";
git push -u origin --all
flag=$?;
while [ $flag -ne 0 ]; do
clear;
((i+=1));
printf "${PRIMARY_COLOR}Trying push: ${COUNT_COLOR}${PWD##*/} ${i}${ACCENT_COLOR}\n";
git push -u origin --all
flag=$?;
done
printf "${PRIMARY_COLOR}Push completed for: ${SUCCESS_COLOR}${PWD##*/}\n";
printf "${ERROR_COLOR}.\n";
printf "${ERROR_COLOR}.\n";
printf "${ERROR_COLOR}.\n";
exit