Clean up syncing

This commit is contained in:
Ryan Hughes committed 2025-08-28 19:13:04 +03:00
1 parent e7e094032e
commit 0735958154
1 file changed
+26 -2
+26 -2
View File
@@ -1,8 +1,32 @@
#!/bin/bash
# Default remote
REMOTE="pkgs.omarchy.org:omarchy-pkgs"
# Parse arguments
if [ $# -eq 0 ]; then
echo "Usage: sync-repo.sh [directory]"
echo "Usage: $0 [directory] [options]"
echo "Options:"
echo " --remote <remote> Specify rclone remote (default: pkgs.omarchy.org:omarchy-pkgs)"
exit 1
fi
rclone sync "$1" "pkgs.omarchy.org:omarchy-pkgs/$(basename $1)" --checksum --progress --copy-links --delete-after -v
DIRECTORY="$1"
shift
# Parse optional arguments
while [[ $# -gt 0 ]]; do
case $1 in
--remote)
REMOTE="$2"
shift 2
;;
*)
echo "Unknown option: $1"
exit 1
;;
esac
done
echo "Syncing to: $REMOTE"
rclone sync "$DIRECTORY" "$REMOTE/$(basename $DIRECTORY)" --checksum --progress --copy-links --delete-after -v