#!/bin/bash # Verify the directories a Hermes Agent profile ships into -- on the tree the # script is run from, not on the host it was written on. # # Q109. This script used to test three absolute paths under the root user's # home, so it printed its three ticks and "All critical paths verified" rc 0 on # any tree, and it read nothing relative to itself. It now resolves # - its own directory from $0 (so the sibling snippet.py it names is the one # that shipped beside it, and a lone copy has no opinion to report), and # - the profile home from --home, else $HERMES_HOME, else # ~/.hermes/profiles/$HERMES_PROFILE (default profile: spark), with the # Hermes root from --root, else the parent of the profile home's `profiles` # directory, else the profile home's own parent, # so the same invocation fails on a tree that is missing the paths it names. # # Exit codes follow the repo's tools/ contract: # 0 = every required path exists # 1 = a required path is missing (each is printed on its own MISSING: line) # 2 = usage error, or the script's own directory could not be resolved set -u HERE=$(cd -- "$(dirname -- "$(readlink -f -- "$0")")" && pwd) || { echo "could not resolve the script's own directory" >&2 exit 2 } PROFILE=${HERMES_PROFILE:-spark} HOME_ARG="" ROOT_ARG="" usage() { cat <<'USAGE' usage: verify_hermes_setup.sh [--home DIR] [--root DIR] [--profile NAME] Grades one Hermes installation: ROOT the Hermes root HOME the profile home (ROOT/profiles/NAME, usually) HOME/cache/scratch the profile's scratch directory