-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgithub.sh
More file actions
executable file
·39 lines (31 loc) · 779 Bytes
/
github.sh
File metadata and controls
executable file
·39 lines (31 loc) · 779 Bytes
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
#!/bin/bash
#############################
#THIS SCRIPT FOR EASY TO MANAGE GITHUB
#############################
PROJECTDIR=$1
#SWITCH TO PROJECT DIR
cd $PROJECTDIR
CMD=$2
COMMIT=$3
DATE=$(date "+%Y%m%d/%H%M")
if [ "X$CMD" == "Xadd" ]; then
{
echo "START ADD AND UPDATE DATA TO GITHUB IN $DATE"
echo "-----------------------"
git add $PROJECTDIR
git commit -m "$COMMIT" $PROJECTDIR
git push -u origin master
echo "-----------------------"
} >> /tmp/github.log 2>&1
fi
if [ "X$CMD" == "Xupdate" ]; then
{
echo "START UPDATE DATA TO GITHUB IN $DATE"
echo "-----------------------"
git commit -m "$COMMIT" $PROJECTDIR
git push -u origin master
echo "-----------------------"
} >> /tmp/github.log 2>&1
fi
#############################
exit 0