Add LED tool: device, CLI, web UI, build scripts, and tests
- device.py: device communication/handling - cli.py: CLI interface updates - web.py: web interface - build.py, build.sh, install.sh: build and install scripts - Pipfile: Python dependencies - lib/mpremote: mpremote library - test_*.py: import and LED tests - Updated .gitignore and README Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
32
install.sh
Executable file
32
install.sh
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/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
|
||||
Reference in New Issue
Block a user