mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-01 18:25:00 +00:00
refactor: encapsulate rsync logic in function and add continuous sync loop
This commit is contained in:
parent
2ec576e110
commit
1e54ca82b8
1 changed files with 19 additions and 7 deletions
|
@ -19,15 +19,27 @@ git -C "$REPO_ROOT" ls-files --exclude-standard --others --ignored --directory >
|
||||||
# Create remote directory if needed
|
# Create remote directory if needed
|
||||||
ssh "$DEST" "mkdir -p ~/aider"
|
ssh "$DEST" "mkdir -p ~/aider"
|
||||||
|
|
||||||
# Sync the repository
|
sync_repo() {
|
||||||
rsync -avz --delete \
|
# Sync the repository
|
||||||
--exclude-from="$EXCLUDE_FILE" \
|
rsync -avz --delete \
|
||||||
"$REPO_ROOT/" \
|
--exclude-from="$EXCLUDE_FILE" \
|
||||||
"$DEST:~/aider/"
|
"$REPO_ROOT/" \
|
||||||
|
"$DEST:~/aider/" || true
|
||||||
|
|
||||||
|
rsync -a .env .gitignore "$DEST:~/aider/." || true
|
||||||
|
|
||||||
rsync -a .env .gitignore "$DEST:~/aider/."
|
echo Done syncing, waiting.
|
||||||
|
}
|
||||||
|
|
||||||
|
sync_repo
|
||||||
|
|
||||||
rsync -a ~/dotfiles/screenrc "$DEST:.screenrc"
|
while true; do
|
||||||
|
fswatch -o $REPO_ROOT | while read ; do
|
||||||
|
sync_repo
|
||||||
|
done
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
# Clean up
|
# Clean up
|
||||||
rm "$EXCLUDE_FILE"
|
rm "$EXCLUDE_FILE"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue