fleetcode/dev.sh

37 lines
775 B
Bash
Executable file

#!/usr/bin/env bash
# Development helper script for FleetCode on NixOS
set -e
echo "🚀 FleetCode Development Script"
echo ""
# Check if we're in a nix shell
if [ -z "$ELECTRON_OVERRIDE_DIST_PATH" ]; then
echo "📦 Entering Nix development shell..."
exec nix develop --command bash "$0" "$@"
fi
# Check if node_modules exists
if [ ! -d "node_modules" ]; then
echo "📦 Installing dependencies..."
npm install
echo ""
fi
# Check if native modules are built
if [ ! -f "node_modules/node-pty/build/Release/pty.node" ]; then
echo "🔧 Rebuilding native modules for Electron..."
npm run rebuild
echo ""
fi
# Build and run
echo "🏗️ Building application..."
npm run build
echo ""
echo "🚀 Starting FleetCode..."
echo ""
electron .