-
-
Notifications
You must be signed in to change notification settings - Fork 173
/
Copy pathbuild.sh
executable file
·43 lines (38 loc) · 1019 Bytes
/
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
#!/usr/bin/env bash
dirpath=$(dirname "$(readlink -f "$0")")
# Check if the virtual environment exists
if [ ! -d "$dirpath/env" ]; then
echo
echo "No virtual environment found! Run setup_env.sh to set it up first."
echo
read -p "Press any key to continue..."
exit 1
fi
# Check if PyInstaller is installed in the virtual environment
if [ ! -f "$dirpath/env/bin/pyinstaller" ]; then
echo
echo "Installing PyInstaller..."
"$dirpath/env/bin/pip" install pyinstaller
if [ $? -ne 0 ]; then
echo
echo "Failed to install PyInstaller."
echo
read -p "Press any key to continue..."
exit 1
fi
fi
# Run PyInstaller with the specified build spec file
echo
echo "Building..."
"$dirpath/env/bin/pyinstaller" "$dirpath/build.spec"
if [ $? -ne 0 ]; then
echo
echo "PyInstaller build failed."
echo
read -p "Press any key to continue..."
exit 1
fi
echo
echo "Build completed successfully."
echo
read -p "Press any key to continue..."