#!/usr/bin/env bash # Install script - installs dependencies and copies binary to ~/.local/bin set -e echo "Installing dependencies..." pipenv install "$@" # Build binary if it doesn't exist or if source is newer if [ ! -f "dist/led-cli" ] || [ "cli.py" -nt "dist/led-cli" ] || [ "device.py" -nt "dist/led-cli" ]; then echo "" echo "Building binary..." pipenv run pyinstaller --clean led-cli.spec fi # Ensure ~/.local/bin exists mkdir -p ~/.local/bin # Copy binary to ~/.local/bin if [ -f "dist/led-cli" ]; then echo "" echo "Installing binary to ~/.local/bin/led-cli..." cp dist/led-cli ~/.local/bin/led-cli chmod +x ~/.local/bin/led-cli echo "✓ Binary installed successfully!" echo "" echo "You can now run 'led-cli' from anywhere." echo "Make sure ~/.local/bin is in your PATH." else echo "Error: Binary not found at dist/led-cli" >&2 exit 1 fi