-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvalidate
More file actions
executable file
·15 lines (15 loc) · 849 Bytes
/
Copy pathvalidate
File metadata and controls
executable file
·15 lines (15 loc) · 849 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/env bash
# SANTA schema gate — validate the committed vectors against the eval-tier JSON Schemas. Same
# self-provision as ./conform (rust via tools/mise.toml); builds + runs the Rust `validate`.
# (Replaces the former `.venv/bin/python schema/validate.py`.)
set -euo pipefail
d="$(cd "$(dirname "$0")" && pwd)"
if [ -z "${SANTA_TOOLS_MISE:-}" ]; then
mise trust "$d/tools/mise.toml" >/dev/null
mise --cd "$d/tools" install
# Re-exec under the tools' mise. Use an ABSOLUTE self-path: `mise --cd` changes the
# command's cwd to tools/, so a relative "$0" (e.g. ./validate) would resolve to
# tools/validate and fail ("couldn't exec process: Permission denied").
exec env SANTA_TOOLS_MISE=1 mise --cd "$d/tools" exec -- "$d/$(basename "$0")" "$@"
fi
exec cargo run --manifest-path "$d/tools/Cargo.toml" -p validate -q -- "$@"