-
Notifications
You must be signed in to change notification settings - Fork 9
/
GitTools.sh
69 lines (64 loc) · 1.73 KB
/
GitTools.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
#!/bin/bash
VERSION="v1.0.0"
OWO_VERSION="1.0.5-dev"
PREFIX="[OwOTools]"
echo "-------------------------------------------------------------"
echo " OwOFrame Git Toolbox is Running ${VERSION}"
echo "-------------------------------------------------------------"
echo "Git Enviroment needed!"
echo -e
echo -e
echo -e
echo "${PREFIX} Please choose one selection:"
echo "[0] git pull Get current branch latest changes from GitHub upstream"
echo "[1] git status Get the change status of the current local branch"
echo "[2] git checkout master To change current branch to "master""
echo "[3] git checkout ${OWO_VERSION} To change current branch to "${OWO_VERSION}""
echo "[4] composer install To install OwOFrame in current path"
echo "[x] exit Exit the toolbox"
read -p "${PREFIX} Your choose: " INPUT
echo -e
echo -e
if [ $INPUT ]
then
if [ $INPUT == 0 ]
then
echo "Checking upstrem..."
git pull
echo -e
echo -e
echo -e
elif [ $INPUT == 1 ]
then
echo "Checking locate status..."
git status
echo -e
echo -e
echo -e
elif [ $INPUT == 2 ]
then
git checkout master
elif [ $INPUT == 3 ]
then
git checkout $OWO_VERSION
elif [ $INPUT == 4 ]
then
composer install
elif [ $INPUT == "x" ]
then
echo -e
echo -e
echo "---------------------"
echo "${PREFIX} Byebye~"
echo "---------------------"
echo -e
exit
else
echo "Unknown usage! Script will terminate here."
fi
else
echo "${PREFIX} Error Input, stop to run this script."
fi
echo -e "Press any keys to continue..."
read -n 1
exit