Spaces:
Sleeping
Sleeping
| # Create a macOS .app and .dmg from app.py using PyInstaller | |
| # Run this on macOS only. | |
| set -euo pipefail | |
| VENV=.venv | |
| if [ ! -d "$VENV" ]; then | |
| python3 -m venv "$VENV" | |
| fi | |
| source "$VENV/bin/activate" | |
| pip install --upgrade pip | |
| pip install -r requirements.txt pyinstaller | |
| # Build .app | |
| pyinstaller --windowed --name ADM_PURCHASING_TOOLS app.py | |
| # Optionally create a DMG (requires hdiutil on macOS) | |
| APP_DIST=dist/ADM_PURCHASING_TOOLS | |
| if [ -d "$APP_DIST" ]; then | |
| DMG_NAME="ADM_PURCHASING_TOOLS_$(date +%Y%m%d_%H%M%S).dmg" | |
| hdiutil create -volname ADM_PURCHASING_TOOLS -srcfolder "$APP_DIST" -ov -format UDZO "$DMG_NAME" | |
| echo "Created $DMG_NAME" | |
| else | |
| echo "Could not find app at $APP_DIST" | |
| fi | |