#!/bin/bash # Build script for macOS executable (Web-based UI) echo "=== ESP32 Flasher (Web UI) - macOS Build Script ===" echo "" # Check if running on macOS if [[ "$OSTYPE" != "darwin"* ]]; then echo "❌ Error: This script is for macOS only." echo " Use build_web_windows.bat on Windows." exit 1 fi # Create virtual environment if it doesn't exist if [ ! -d "venv" ]; then echo "Creating virtual environment..." python3 -m venv venv fi echo "Activating virtual environment..." source venv/bin/activate echo "Installing dependencies..." pip install -r requirements.txt echo "" echo "Building macOS application bundle..." pyinstaller ESP32_WebFlasher_macOS.spec echo "" if [ -d "dist/ESP32_Flasher.app" ]; then echo "✓ Build complete!" echo "" echo "Application created at: dist/ESP32_Flasher.app" echo "" echo "To run the application:" echo " open dist/ESP32_Flasher.app" echo "" echo "The app will open in your default web browser!" else echo "❌ Build failed - application not found in dist folder" exit 1 fi