-
Notifications
You must be signed in to change notification settings - Fork 1
/
gitcreatepr.sh
90 lines (69 loc) · 1.47 KB
/
gitcreatepr.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
82
83
84
85
86
87
88
89
90
#!/bin/bash
# https://github.com/github/hub
# Must be ssh cloned
author=$1
# Remove dots
author=`echo "${author//./}"`
# Remove slashes
author=`echo $author | sed 's,/,,g'`
nospaceauthor=${author//[[:blank:]]/}
note=$2
repo=$3
cd "/var/www/materialos.com/public_html/uploads/$repo/"
if [ ! -d "$author" ]; then
mkdir "$author"
fi
cd ./"$author"/
if [ -f *.ai ]; then
if [ ! -d "Vector" ]; then
mkdir Vector
fi
mv *.ai ./Vector
fi
if [ -f *.svg ]; then
if [ ! -d "Vector" ]; then
mkdir Vector
fi
mv *.svg ./Vector
fi
if [ -f *.sketch ]; then
if [ ! -d "Vector" ]; then
mkdir Vector
fi
mv *.sketch ./Vector
fi
if [ -f *.xcf ]; then
if [ ! -d "Raster Editor" ]; then
mkdir "Raster Editor"
fi
mv *.xcf ./"Raster Editor"
fi
if [ -f *.psd ]; then
if [ ! -d "Raster Editor" ]; then
mkdir "Raster Editor"
fi
mv *.psd ./"Raster Editor"
fi
if [ -f *.png ]; then
if [ ! -d "Raster" ]; then
mkdir Raster
fi
mv *.png ./Raster
fi
cd ..
tyme=`date +%Y%m%d%H%M%S`
git checkout -b $nospaceauthor$tyme
git add *
git commit -m "Added some $repo by $author! Thanks $author!"
git push --set-upstream origin $nospaceauthor$tyme
hub pull-request -m "Added some $repo by $author! Thanks $author!
$note" -b materialos:master -h autocontribute:$nospaceauthor$tyme
git checkout master
git fetch --all
git reset --hard origin/master
git pull
git remote add upstream https://github.com/materialos/$repo/
git fetch upstream
git checkout master
git merge upstream/master
git push