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"