forked from breschio/drawbridge
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun-demo.sh
More file actions
executable file
·81 lines (72 loc) · 2.3 KB
/
run-demo.sh
File metadata and controls
executable file
·81 lines (72 loc) · 2.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/bin/bash
# Moat Runner - Automated task processing workflow (for demo)
echo "🚀 Starting Moat (Demo Mode)..."
# Check if we're in the right directory
if [ ! -d "demo/.moat" ]; then
echo "❌ Error: Not in Moat demo project directory or .moat folder not found"
echo " Please run this script from the project root"
exit 1
fi
# Function to check if a process is running
check_process() {
pgrep -f "$1" > /dev/null
}
# Check HTTP server
if check_process "python.*http.server 8000"; then
echo "✅ HTTP Server: Already running on http://localhost:8000"
else
echo "🔄 Starting HTTP server..."
cd demo
python3 -m http.server 8000 > /dev/null 2>&1 &
cd ..
sleep 2
if check_process "python.*http.server 8000"; then
echo "✅ HTTP Server: Started on http://localhost:8000"
else
echo "❌ Failed to start HTTP server"
exit 1
fi
fi
# Check Moat watcher
if check_process "moat-watcher.js"; then
echo "✅ Moat Watcher: Already running"
else
echo "🔄 Starting Moat watcher..."
cd demo
node ../moat-watcher.js > /dev/null 2>&1 &
cd ..
sleep 2
if check_process "moat-watcher.js"; then
echo "✅ Moat Watcher: Started and monitoring"
else
echo "❌ Failed to start Moat watcher"
exit 1
fi
fi
# Check for pending tasks
if [ -f "demo/.moat/moat-tasks.md" ]; then
PENDING_COUNT=$(grep -c "^[0-9]\+\. \[ \]" demo/.moat/moat-tasks.md 2>/dev/null || echo "0")
TOTAL_COUNT=$(grep -c "^[0-9]\+\." demo/.moat/moat-tasks.md 2>/dev/null || echo "0")
echo ""
echo "📋 Task Status:"
echo " Total Tasks: $TOTAL_COUNT"
echo " Pending Tasks: $PENDING_COUNT"
if [ "$PENDING_COUNT" -gt "0" ]; then
echo ""
echo "🎯 Ready for task processing!"
echo " Next: Ask Cursor to 'process tasks' to handle pending items"
else
echo " ✅ All tasks completed!"
fi
else
echo "📋 No task file found - ready for new annotations"
fi
echo ""
echo "🧭 Moat is ready! (Demo Mode)"
echo " 🌐 Demo: http://localhost:8000"
echo " 🔄 Watcher: Active"
echo " 📱 Extension: Ready for annotations"
echo ""
echo "Next steps:"
echo " • Create annotations in Chrome with Moat extension"
echo " • Ask Cursor to 'run moat' to process any new tasks"