-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·50 lines (40 loc) · 1.08 KB
/
Copy pathbuild.sh
File metadata and controls
executable file
·50 lines (40 loc) · 1.08 KB
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
#!/bin/bash
set -e
SCRIPT_NAME="SLScheevo.py"
OUTPUT_NAME="SLScheevo"
VENV_DIR=".venv"
echo "Setting up build environment..."
# Check if Python 3 is available
if ! command -v python3 &>/dev/null; then
echo "Error: python3 not found"
exit 1
fi
# Create virtual environment
echo "Creating Python virtual environment..."
python3 -m venv .venv
# Activate virtual environment
echo "Activating virtual environment..."
source .venv/bin/activate
# Install requirements
echo "Installing requirements..."
pip install --upgrade pip setuptools wheel pyinstaller
pip install -r requirements.txt
# Create build directory
mkdir -p build
# Build with PyInstaller
echo "Building executable with PyInstaller..."
pyinstaller --onefile \
--name "$OUTPUT_NAME" \
--distpath ./build \
--workpath ./build/temp \
--specpath ./build \
"$SCRIPT_NAME"
# Check build success
if [ -f "./build/$OUTPUT_NAME" ] || [ -f "./build/$OUTPUT_NAME.exe" ]; then
echo "Build successful! Executable created: ./build/$OUTPUT_NAME"
else
read -p "Build failed!"
exit 1
fi
deactivate
echo "Done!"