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.
23 lines
898 B
Bash
Executable File
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
|