Files
led-tool/install.sh

33 lines
938 B
Bash
Executable File

#!/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 --onefile --name led-cli --paths lib cli.py
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