-
Notifications
You must be signed in to change notification settings - Fork 0
/
compile.sh
37 lines (30 loc) · 819 Bytes
/
compile.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
#!/usr/bin/env bash
#
# This script assumes a linux environment
function compile {
echo "Compiling..."
#* Currently, I'm using the spec file to rename the executable with the OS and architecture
#* Yes, the spec file is a python script
pyinstaller TwitchFarm.spec
# Remove the Build folder
rm -r "build"
}
if [[ -z "$VIRTUAL_ENV" ]]; then
echo ""
echo "No VIRTUAL_ENV detected"
if [[ $1 =~ --ignore-warning ]]; then
compile
exit 0
fi
echo "Compiling should be performed inside of a virtual environment" \
"to prevent errors and reduce bundle size."
echo "If you want to ignore this warning, pass '--ignore-warning' as an argument."
echo ""
exit 1
else
echo ""
echo "VIRTUAL_ENV is set"
compile
echo ""
exit 0
fi