/ dev.sh
dev.sh
 1  #!/usr/bin/env bash
 2  # Development helper script for FleetCode on NixOS
 3  
 4  set -e
 5  
 6  echo "🚀 FleetCode Development Script"
 7  echo ""
 8  
 9  # Check if we're in a nix shell
10  if [ -z "$ELECTRON_OVERRIDE_DIST_PATH" ]; then
11      echo "📦 Entering Nix development shell..."
12      exec nix develop --command bash "$0" "$@"
13  fi
14  
15  # Check if node_modules exists
16  if [ ! -d "node_modules" ]; then
17      echo "📦 Installing dependencies..."
18      npm install
19      echo ""
20  fi
21  
22  # Check if native modules are built
23  if [ ! -f "node_modules/node-pty/build/Release/pty.node" ]; then
24      echo "🔧 Rebuilding native modules for Electron..."
25      npm run rebuild
26      echo ""
27  fi
28  
29  # Build and run
30  echo "🏗️  Building application..."
31  npm run build
32  echo ""
33  
34  echo "🚀 Starting FleetCode..."
35  echo ""
36  electron .