-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrun-all-scripts.sh
executable file
·51 lines (45 loc) · 1.18 KB
/
run-all-scripts.sh
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
#!/bin/bash
success=()
failed=()
api_version=$(head -n 1 ./VERSION)
examples_version=$(git rev-parse --short HEAD)
for script in src/main/scripts/*.ts; do
echo "Running $script..."
if ts-node "$script"; then
echo "Script $script passed"
success+=("$script")
else
echo "Script $script failed"
failed+=("$script")
fi
done
echo -e "\n📊 Summary Report"
echo -e "================="
echo -e "DEFI API Version: v$api_version"
echo -e "Examples Version: $examples_version\n"
echo "✅ Successful Scripts (${#success[@]}):"
echo "--------------------------------"
if [ ${#success[@]} -eq 0 ]; then
echo "No successful scripts"
else
for s in "${success[@]}"; do
echo " ✓ $(basename "$s")"
done
fi
echo -e "\n❌ Failed Scripts (${#failed[@]}):"
echo "----------------------------"
if [ ${#failed[@]} -eq 0 ]; then
echo "No failed scripts"
else
for f in "${failed[@]}"; do
echo " ✗ $(basename "$f")"
done
fi
echo -e "\n=================\n"
if [ ${#failed[@]} -ne 0 ]; then
echo "❌ ${#failed[@]} script(s) failed out of $((${#success[@]} + ${#failed[@]})) total scripts"
exit 1
else
echo "✅ All ${#success[@]} scripts completed successfully!"
exit 0
fi