#!/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/dev/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