-
Notifications
You must be signed in to change notification settings - Fork 2
/
init.sh
executable file
·55 lines (55 loc) · 2.13 KB
/
init.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
#!/bin/bash
cd "${0%/*}"
if [ -f 'Resources/mcp25.zip' ] && [ -f 'Resources/minecraft_server.jar' ]; then
echo 'Resources already exist.'
else
rm -rf 'Resources'
mkdir 'Resources'
cd 'Resources'
curl -o 'mcp25.html' 'http://www.mediafire.com/file/7422b88qu650547/mcp25.zip/file'
curl -O "$(egrep -o -m 1 'http://download.{20,40}/7422b88qu650547/mcp25\.zip' mcp25.html | head -1)"
rm -f 'mcp25.html'
curl -O 'https://web.archive.org/web/20101205185606/http://www.minecraft.net:80/download/minecraft_server.jar'
cd '..'
fi
rm -rf 'Minecraft-Alpha-Server'
mkdir 'Minecraft-Alpha-Server'
cp -rf 'Minecraft-Alpha-Server-Init/.' 'Minecraft-Alpha-Server'
cd 'Minecraft-Alpha-Server'
git init
git config core.autocrlf true
cp -f '../Resources/mcp25.zip' 'mcp25.zip'
unzip 'mcp25.zip'
sed -i 's/python/python2/g' scripts-linux/decompile.sh scripts-linux/reobf.sh scripts-linux/update_names.sh tools-linux/annotate_gl_constants.py tools-linux/get_csv.py
cp -rf 'scripts-linux/.' '.'
rm -rf 'jars'
mkdir 'jars'
cp -f '../Resources/minecraft_server.jar' 'jars/minecraft_server.jar'
case "$(uname -s)" in
MINGW*|CYGWIN*)
git update-index --add --chmod='+x' 'cleanup.sh'
git update-index --add --chmod='+x' 'decompile.sh'
git update-index --add --chmod='+x' 'recompile.sh'
git update-index --add --chmod='+x' 'reobf.sh'
git update-index --add --chmod='+x' 'setup.sh'
git update-index --add --chmod='+x' 'test_game.sh'
git update-index --add --chmod='+x' 'test_server.sh'
git update-index --add --chmod='+x' 'update_names.sh'
./decompile.bat
;;
*)
chmod +x 'cleanup.sh'
chmod +x 'decompile.sh'
chmod +x 'recompile.sh'
chmod +x 'reobf.sh'
chmod +x 'setup.sh'
chmod +x 'test_game.sh'
chmod +x 'test_server.sh'
chmod +x 'update_names.sh'
./decompile.sh
;;
esac
git add '.'
git -c 'user.name=stonar96' -c '[email protected]' commit -m 'Initial commit' --date='Sun Jan 1 00:00:00 2017 +0200'
# https://stackoverflow.com/q/46395528
GIT_COMMITTER_DATE='Sun Jan 1 00:00:00 2017 +0200' git -c 'user.name=stonar96' -c '[email protected]' commit --amend --no-edit