-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patheazygit
More file actions
138 lines (122 loc) · 5.8 KB
/
eazygit
File metadata and controls
138 lines (122 loc) · 5.8 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
#!/bin/bash
zeCh-banner() {
echo -e "\033[0;32m ______ _____ _ _ "
echo -e " | ____| / ____(_) | "
echo -e " | |__ __ _ _____ _ | | __ _| |_ "
echo -e " | __| / _' |_ / | | | | | |_ | | __| "
echo -e " | |___| (_| |/ /| |_| | | |__| | | |_ "
echo -e " |______\__,_/___|\__, | \_____|_|\__| "
echo -e " __/ | "
echo -e " |___/ \033[0;0m"
echo -e " ┌─────────────────────────────────────────────────────────────────────────────────────────────────────────┐"
echo -e " │ \033[0;34mName\033[0;0m : \033[0;36mEazy Git\033[0;0m │"
echo -e " │ \033[0;34mVersion\033[0;0m : \033[0;36m0.9\033[0;0m │"
echo -e " │ \033[0;34mCoded By\033[0;0m : \033[0;36mZech Bron\033[0;0m │"
echo -e " │ \033[0;34mGitHub\033[0;0m : \033[0;36mhttps://github.com/ZechBron\033[0;0m │"
echo -e " │ │"
echo -e " │ \033[0;34mDescription\033[0;0m : │"
echo -e " │ \033[0;36mYou don't have to type long commands. You can upload file in your repository using 1 commamd only.\033[0;0m │"
echo -e " │ \033[0;34mTo Users\033[0;0m : │"
echo -e " │ \033[0;36mFirst of all, thank you for using eazygit, guyz. You know I am a noob. I am still a begineer so if \033[0;0m│"
echo -e " │ \033[0;36myou encounter an error please tell me about it by opening an issue here:\033[0;0m \033[0;32mhttps://github,com/ZechBron \033[0;0m│"
echo -e " │ \033[0;32m/EazyGit/issues\033[0;0m \033[0;36mIf you're also a programmer, you know I'm always open for ideas. So if you have any \033[0;0m"│
echo -e " │ \033[0;36msuggestions, comments, or if you have questions, just open a discussion here:\033[0;0m \033[0;32mhttps://github,com/Zec │"
echo -e " │ hBron/EazyGit/discussions \033[0;0m│"
echo -e " └─────────────────────────────────────────────────────────────────────────────────────────────────────────┘"
}
# eazygit -c file -h commit -b url
# eazygit -c file -z -b url
# eazygit -n name -e email
# eazygit -? || --help
# eazygit -i || --info
# eazygit -u || --update
if [ "$1" == "-u" ] || [ "$1" == "--update" ]; then
cd $HOME
rm -rf EazyGit
echo -e "\e[92mPlease Choose:"
echo -e " 1. Linux\n 2. Termux - Android\n 3. Git Bash - Windows\e[0m"
read zCh
if [ $zCh = 1 ]; then
sudo rm -rf /bin/eazygit
sudo rm -rf /usr/bin/eazygit
elif [ $zCh = 2 ]; then
rm -rf $PREFIX/bin/eazygit
elif [ $zCh = 3 ]; then
rm -rf /bin/eazygit
rm -rf /usr/bin/eazygit
else
echo -e "\e[91mWrong input\e[0m"
fi
git clone https://github.com/ZechBron/EazyGit
echo "Please type this one line command:"
echo " cd EazyGit && bash setup"
fi
if [ "$1" == "-i" ] || [ "$1" == "--info" ]; then
zeCh-banner
fi
if [ "$1" == "-?" ] || [ "$1" == "--help" ]; then
echo -e "USAGE:\n"
echo -e "Setup:"
echo -e " eazygit -n username -e email\n"
echo -e "Usage with commit message: "
echo -e " eazygit -c filename -h commit message -b url\n"
echo -e "Usage with default commit message: "
echo -e " eazygit -c filename -z -b url\n"
echo -e "Instructions:"
echo -e " Use proper order."
echo -e " When using default commit '-z' do not add other stuff"
echo -e "\nOptions:"
echo -e " -n \t\t github username"
echo -e " -e \t\t github email"
echo -e " -c \t\t filename"
echo -e " -h \t\t commit message"
echo -e " -z \t\t default commit message"
echo -e " -b \t\t github url repository"
echo -e " -? or --help \t display help message"
echo -e " -i or --info \t display information"
echo -e " -u or --update\t update eazygit"
fi
# Setup
if [ "$1" == "-n" ]; then
rm -rf .gitconfig .git
git config --global user.name $2
if [ "$3" == "-e" ]; then
git config --global user.email $4
fi
fi
if [ "$1" == "-c" ]; then
# If file exist
if [ -e "$2" ]; then
git init
git add $2
if [ "$3" == "-h" ]; then
git commit -m "$4"
git branch -M master
if [ "$5" == "-b" ]; then
git remote add origin $6
fi
fi
if [ "$3" == "-z" ]; then
git commit -m "Initial commit"
git branch -M master
if [ "$4" = "-b" ]; then
git remote add origin $5
fi
fi
git push -u origin master
# If file not exist
elif [ ! -e "$2" ]; then
echo -e "\e[91m$2 file does not exist\e[0m"
fi
fi
if [ -z "$1" ]; then
echo -e "Basic Usage\n"
echo -e "Setup this first:"
echo -e "\teazygit -n username -e email\n"
echo -e "With Commit Message:"
echo -e "\teazygit -c file -h commit -b url\n"
echo -e "With Default Commit Message:"
echo -e "\teazygit -c file -z -b url\n"
echo -e "For more info type:"
echo -e "\teazygit -? or eazygit --help"
fi