Files
dotfiles-public/.tests/lab/check-verbatim.sh
T
bcherb2 e7bc5fdaff chore: lab verbatim check defaults to $HOME, and the fake private tier is resynced
The default named a real home path in the public tier (SEC-1), and two of
the three verbatim copies had drifted from the private repo.
2026-11-18 02:45:19 -05:00

23 lines
898 B
Bash
Executable File

#!/bin/sh
# The fake private repo copies three files verbatim from the real one, so the
# scenarios measure the shipping implementation rather than a paraphrase of it.
# A verbatim copy silently stops being verbatim the moment the original is
# edited -- which happened within the hour of creating it. Check, don't hope.
set -eu
cd "$(dirname "$0")"
REAL=${1:-$HOME/code/dotfiles-private}
rc=0
for f in .chezmoiignore run_after_50-secrets.sh.tmpl \
dot_local/bin/private_executable_dotsecrets.tmpl; do
if [ ! -f "$REAL/$f" ]; then
echo "MISSING in the real repo: $f" >&2; rc=1; continue
fi
if ! diff -q "$REAL/$f" "fake-private/$f" >/dev/null; then
echo "DRIFTED: fake-private/$f no longer matches $REAL/$f" >&2
echo " fix: cp '$REAL/$f' '$PWD/fake-private/$f'" >&2
rc=1
fi
done
[ "$rc" -eq 0 ] && echo "fake-private: all three verbatim copies match the real repo"
exit $rc