mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-22 21:34:59 +00:00
28 lines
613 B
Bash
Executable file
28 lines
613 B
Bash
Executable file
#!/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"
|
|
|
|
# Create remote directory if needed
|
|
ssh "$DEST" "mkdir -p ~/aider"
|
|
|
|
# Sync the repository
|
|
rsync -avz --delete \
|
|
--exclude='.git/' \
|
|
--exclude-from="$EXCLUDE_FILE" \
|
|
"$REPO_ROOT/" \
|
|
"$DEST:~/aider/"
|
|
|
|
# Clean up
|
|
rm "$EXCLUDE_FILE"
|