#!/bin/sh
# script/fmt-check: check formatting across the whole repo (read-only).
# Same scope as script/fmt, but fails instead of writing.
# The org model checks only markdown; this repo also has JS and Go.
set -eu

ROOT="$(cd "$(dirname "$0")/.." && pwd -P)"

main() {
    cd "$ROOT"
    # script/bootstrap links the node, yarn and gofmt it installs into
    # ~/.local/bin, which the shell that called it may not have on PATH.
    PATH="$HOME/.local/bin:$PATH"
    "$ROOT/script/frontend-fmt-check"
    "$ROOT/backend/script/fmt-check"
}

main "$@"
