diff --git a/bootstrap.sh b/bootstrap.sh index 9a5f470..21c9562 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -298,7 +298,13 @@ check_clean() { deliver_repo() { local src=$1 remote_dir=$2 label=$3 dest=$4 commit commit=$(git -C "$src" rev-parse HEAD) || die "could not resolve HEAD for $label ($src)" - ssh "${SSH_OPTS[@]}" "$FLIT_USER@$dest" "mkdir -p ~/$remote_dir" \ + # Replaced, not extracted over. `git archive | tar -x` never removes + # anything, so a file deleted from the source repository used to live in the + # staging directory forever and be re-delivered from there on every run — the + # same defect laptop/sync-config.sh's sync_tree() clears its destination to + # avoid, and it is safe here for the same reason: this directory is staging + # that only phase 2 writes and only server/lib/22-claude-config.sh reads. + ssh "${SSH_OPTS[@]}" "$FLIT_USER@$dest" "rm -rf ~/$remote_dir && mkdir -p ~/$remote_dir" \ || die "could not create ~/$remote_dir on $dest" git -C "$src" archive HEAD \ | ssh "${SSH_OPTS[@]}" "$FLIT_USER@$dest" "tar -x -C ~/$remote_dir" \