forked from MakeICT/event-creator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·64 lines (56 loc) · 1.38 KB
/
build.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
#!/bin/bash
function makePackage(){
zip=$1; shift
echo
echo "*** Zipping $zip..."
cd dist
zip -r $zip plugins/ README.md LICENSE.md $*
cd ..
}
if [ $# -eq 0 ] || [ "$1" == "linux" ]; then
echo "*** Building Linux binary"
linuxBinary=$(pyinstaller build.spec)
if [ $? -ne 0 ]; then
echo
echo "*** Build failed :("
exit 1
fi
fi
if [ $# -eq 0 ] || [ "$1" == "windows" ]; then
echo "*** Building Windows binary"
windowsBinary=$(wine pyinstaller build.spec | tr -d "[:space:]")
if [ $? -ne 0 ]; then
echo
echo "*** Build failed :("
exit 1
fi
fi
echo
echo "*** Copying plugins..."
rm -rf dist/plugins
mkdir dist/plugins
cp -R src/plugins dist/
cp README.md dist/
cp LICENSE.md dist/
echo
echo "*** Cleaning up..."
rm -rf dist/plugins/__init__.py* dist/plugins/__pycache__/
rm -rf dist/plugins/*/*.pyc
rm -rf dist/plugins/*/__pycache__/
rm -rf dist/plugins/GoogleApps/credentials.dat
echo
echo "*** Bundling..."
if [ $# -eq 0 ] || [ "$1" == "linux" ]; then
makePackage $linuxBinary.zip $linuxBinary
fi
if [ $# -eq 0 ] || [ "$1" == "windows" ]; then
makePackage ${windowsBinary%.*}.zip $windowsBinary
fi
windowsBinary=event-creator-v2.1.2-windows.exe
if [ $# -eq 0 ] || [ "$1" == "linux" ]; then
combinedZip=${linuxBinary%-*}-all.zip
makePackage $linuxBinary $windowsBinary
else
combinedZip=${windowsBinary%-*}-all.zip
fi
makePackage $combinedZip $linuxBinary $windowsBinary