/ scripts / agents / rebuild_all.sh
rebuild_all.sh
 1  #!/bin/bash
 2  # Complete clean rebuild of ECHO system
 3  # Run this after ANY code changes to ensure fixes are applied
 4  
 5  set -e
 6  
 7  ECHO_DIR="/Users/pranav/Documents/echo"
 8  cd "$ECHO_DIR"
 9  
10  echo "๐Ÿงน Cleaning all build artifacts..."
11  
12  # Clean shared library
13  cd shared
14  rm -rf _build deps
15  echo "  โœ“ Shared library cleaned"
16  
17  # Clean all agents
18  for agent in ceo cto chro product_manager senior_architect operations_head senior_developer test_lead uiux_engineer; do
19      if [ -d "../apps/$agent" ]; then
20          cd "../apps/$agent"
21          rm -rf _build deps
22          echo "  โœ“ $agent cleaned"
23      fi
24  done
25  
26  cd "$ECHO_DIR"
27  echo ""
28  echo "๐Ÿ”จ Rebuilding shared library..."
29  cd shared
30  mix deps.get > /dev/null 2>&1
31  mix compile 2>&1 | grep -E "Compiling.*echo_shared|Generated.*echo_shared|error"
32  echo "  โœ“ Shared library built"
33  
34  cd "$ECHO_DIR"
35  echo ""
36  echo "๐Ÿ”จ Rebuilding all agents..."
37  
38  for agent in ceo cto chro product_manager senior_architect operations_head; do
39      echo "  Building $agent..."
40      cd "apps/$agent"
41      mix deps.get > /dev/null 2>&1
42      mix compile > /dev/null 2>&1
43      mix escript.build > /dev/null 2>&1
44      echo "    โœ“ $agent built ($(stat -f "%Sm" -t "%H:%M:%S" $agent))"
45      cd "$ECHO_DIR"
46  done
47  
48  echo ""
49  echo "โœ… Complete rebuild finished!"
50  echo ""
51  echo "Agent executables:"
52  ls -lh apps/ceo/ceo apps/cto/cto apps/chro/chro apps/product_manager/product_manager apps/senior_architect/senior_architect apps/operations_head/operations_head 2>/dev/null || echo "Some agents not found"
53  echo ""
54  echo "Now run: ./day2_training_v2.sh"