#!/usr/bin/env bash # Build script for creating binaries set -e echo "Building led-tool binaries..." echo "================================" # Check if we're in a pipenv environment or use pipenv run if command -v pipenv &> /dev/null; then echo "Using pipenv..." pipenv install --dev PYINSTALLER_CMD="pipenv run pyinstaller" else # Check if pyinstaller is available directly if ! command -v pyinstaller &> /dev/null; then echo "Installing PyInstaller..." pip install pyinstaller fi PYINSTALLER_CMD="pyinstaller" fi # Build CLI binary using the spec file echo "" echo "Building CLI binary..." $PYINSTALLER_CMD --clean led-cli.spec echo "" echo "================================" echo "Build complete!" echo "Binary location: dist/led-cli" echo "" echo "To test: ./dist/led-cli -h" echo "" echo "You can distribute the binary from the dist/ directory" echo "without requiring Python to be installed on the target system."