mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-31 09:44:59 +00:00
feat: Add rsync script to sync repo to remote host
This commit is contained in:
parent
256a9951f5
commit
7f7e218504
1 changed files with 25 additions and 0 deletions
|
@ -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"
|
Loading…
Add table
Add a link
Reference in a new issue