From 7f7e218504d027f92cc74a0a02fe491538e457d2 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Thu, 19 Dec 2024 11:43:51 -0800 Subject: [PATCH] feat: Add rsync script to sync repo to remote host --- benchmark/rsync.sh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/benchmark/rsync.sh b/benchmark/rsync.sh index e69de29bb..0564aa23a 100644 --- a/benchmark/rsync.sh +++ b/benchmark/rsync.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +if [ $# -ne 1 ]; then + echo "Usage: $0 user@host" + exit 1 +fi + +DEST="$1" +REPO_ROOT="$(git rev-parse --show-toplevel)" + +# Create a temporary file for rsync exclude patterns +EXCLUDE_FILE=$(mktemp) + +# Convert .gitignore patterns to rsync exclude patterns +git -C "$REPO_ROOT" ls-files --exclude-standard --others --ignored --directory > "$EXCLUDE_FILE" + +# Sync the repository +rsync -avz --delete \ + --exclude='.git/' \ + --exclude-from="$EXCLUDE_FILE" \ + "$REPO_ROOT/" \ + "$DEST:~/aider/" + +# Clean up +rm "$EXCLUDE_FILE"