-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathcheck.sh
More file actions
executable file
·73 lines (67 loc) · 1.43 KB
/
check.sh
File metadata and controls
executable file
·73 lines (67 loc) · 1.43 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
#!/bin/bash
# Function to check cp-agent
check_agent() {
echo "Checking cp-agent..."
cd cp-agent
make format lint test
local status=$?
cd ..
return $status
}
# Function to check cp-webapp
check_webapp() {
echo "Checking cp-webapp..."
cd cp-webapp
pnpm format && pnpm lint
local status=$?
cd ..
return $status
}
# Function to check cp-runner
check_runner() {
echo "Checking cp-runner..."
cd cp-runner
go fmt ./... && go vet ./...
local status=$?
cd ..
return $status
}
# Function to display help
show_help() {
echo "Usage: ./check.sh [project]"
echo "Run code checks for the specified project or all projects if none specified."
echo ""
echo "Options:"
echo " agent Check only cp-agent (Python)"
echo " webapp Check only cp-webapp (Next.js)"
echo " runner Check only cp-runner (Go)"
echo " all Check all projects (default)"
echo " help Show this help message"
}
# Main execution
case "$1" in
"agent")
check_agent
;;
"webapp")
check_webapp
;;
"runner")
check_runner
;;
"help")
show_help
exit 0
;;
*)
echo "Checking all projects..."
check_agent && check_webapp && check_runner
;;
esac
status=$?
if [ $status -eq 0 ]; then
echo "All checks passed! 🎉"
else
echo "Checks failed with status $status ❌"
fi
exit $status