-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstack-check.sh
More file actions
executable file
·40 lines (35 loc) · 1005 Bytes
/
Copy pathstack-check.sh
File metadata and controls
executable file
·40 lines (35 loc) · 1005 Bytes
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
#!/usr/bin/env bash
# Check curriculum tools + project health (db validate, optional test).
set -euo pipefail
source "$(dirname "$0")/lib/common.sh"
PROJECT=""
RUN_TESTS="0"
while [[ $# -gt 0 ]]; do
case "$1" in
--project) PROJECT="$2"; shift 2 ;;
--test) RUN_TESTS="1"; shift ;;
-h|--help)
echo "Usage: stack-check.sh [--project <path>] [--test]"
exit 0
;;
*) log_fail "Unknown: $1"; exit 1 ;;
esac
done
CURR="$(curriculum_root)"
log_section "Curriculum doctor"
node "$CURR/scripts/init/doctor.mjs" || true
if [[ -n "$PROJECT" ]] || [[ -f ".superapp/profile.json" ]]; then
PROJECT_DIR="$(resolve_project_dir "$PROJECT")"
cd "$PROJECT_DIR"
log_section "Project: $(basename "$PROJECT_DIR")"
require_cmd pnpm
pnpm run db:validate
log_ok "db:validate passed"
if [[ "$RUN_TESTS" == "1" ]]; then
pnpm test
log_ok "tests passed"
fi
else
log_info "Skip project checks — pass --project or cd into app folder"
fi
log_ok "Stack check complete"