-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathcheck_examples.sh
More file actions
executable file
·117 lines (98 loc) · 2.66 KB
/
check_examples.sh
File metadata and controls
executable file
·117 lines (98 loc) · 2.66 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
#!/bin/bash
# Example Verification Script
cd "$(dirname "$0")/examples"
echo "🔍 Checking Examples..."
echo
ERRORS=0
# Check each example
for example in actions arm auth fleet metrics mqtt_iot quickstart; do
echo "Checking: $example"
# Check README.md
if [ ! -f "$example/README.md" ]; then
echo " ❌ Missing README.md"
((ERRORS++))
else
echo " ✅ README.md"
fi
# Check Dockerfile.ros2
if [ ! -f "$example/Dockerfile.ros2" ]; then
echo " ❌ Missing Dockerfile.ros2"
((ERRORS++))
else
echo " ✅ Dockerfile.ros2"
fi
# Check docker-compose.yml
if [ ! -f "$example/docker-compose.yml" ]; then
echo " ❌ Missing docker-compose.yml"
((ERRORS++))
else
echo " ✅ docker-compose.yml"
fi
# Check index.html (web dashboard)
if [ ! -f "$example/index.html" ]; then
echo " ❌ Missing index.html"
((ERRORS++))
else
echo " ✅ index.html"
fi
# Check Python file
PY_COUNT=$(find "$example" -maxdepth 1 -name "*.py" -type f | wc -l)
if [ "$PY_COUNT" -eq 0 ]; then
echo " ❌ Missing Python file"
((ERRORS++))
else
echo " ✅ Python file(s): $PY_COUNT"
fi
echo
done
echo "Checking Playground Examples..."
echo
for example in playground/*; do
name=$(basename "$example")
echo "Checking: $name"
# Check README.md
if [ ! -f "$example/README.md" ]; then
echo " ❌ Missing README.md"
((ERRORS++))
else
echo " ✅ README.md"
fi
# Check Dockerfile.ros2
if [ ! -f "$example/Dockerfile.ros2" ]; then
echo " ❌ Missing Dockerfile.ros2"
((ERRORS++))
else
echo " ✅ Dockerfile.ros2"
fi
# Check docker-compose.ros2.yml
if [ ! -f "$example/docker-compose.ros2.yml" ]; then
echo " ❌ Missing docker-compose.ros2.yml"
((ERRORS++))
else
echo " ✅ docker-compose.ros2.yml"
fi
# Check HTML dashboard
HTML_COUNT=$(find "$example" -maxdepth 1 -name "*.html" -type f | wc -l)
if [ "$HTML_COUNT" -eq 0 ]; then
echo " ❌ Missing HTML dashboard"
((ERRORS++))
else
echo " ✅ HTML dashboard: $HTML_COUNT"
fi
# Check ros2 directory
if [ ! -d "$example/ros2" ]; then
echo " ❌ Missing ros2/ directory"
((ERRORS++))
else
echo " ✅ ros2/ directory"
fi
echo
done
echo "================================"
if [ $ERRORS -eq 0 ]; then
echo "✅ All examples are complete!"
exit 0
else
echo "❌ Found $ERRORS issues"
exit 1
fi