From 44ce28a0d85e62ef47c1eed6fe72a1f1c9a5d772 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Fri, 21 Nov 2025 15:01:59 +0100 Subject: [PATCH] Account for multiple subdirectories for syncing --- bin/sync-repo | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/bin/sync-repo b/bin/sync-repo index 1276034..8159bce 100755 --- a/bin/sync-repo +++ b/bin/sync-repo @@ -46,9 +46,11 @@ while [[ $# -gt 0 ]]; do esac done +DESTINATION_DIRECTORY="${DIRECTORY#pkgs.omarchy.org/}" + # Check if syncing to production and warn user if [[ "$REMOTE" == "$DEFAULT_REMOTE" ]] && [[ "$SKIP_PROD_CHECK" != true ]]; then - print_warning "You are about to sync to PRODUCTION ($REMOTE)" + print_warning "You are about to sync to PRODUCTION ($REMOTE/$DESTINATION_DIRECTORY)" echo "" read -p "Are you sure you want to sync to production? (y/N) " -n 1 -r echo @@ -58,12 +60,12 @@ if [[ "$REMOTE" == "$DEFAULT_REMOTE" ]] && [[ "$SKIP_PROD_CHECK" != true ]]; the fi fi -print_info "Syncing to: $REMOTE/$(basename $DIRECTORY)" +print_info "Syncing to: $REMOTE/$DESTINATION_DIRECTORY" # First sync packages (excluding database files to ensure packages are uploaded first) # Use --ignore-existing to not overwrite different versions already on remote print_info "Syncing packages..." -rclone sync "$DIRECTORY" "$REMOTE/$(basename $DIRECTORY)" \ +rclone sync "$DIRECTORY" "$REMOTE/$DESTINATION_DIRECTORY" \ --exclude "omarchy.db*" \ --exclude "omarchy.files*" \ --ignore-existing \ @@ -71,8 +73,8 @@ rclone sync "$DIRECTORY" "$REMOTE/$(basename $DIRECTORY)" \ # Then sync database files last to ensure repository integrity print_info "Updating repository database..." -rclone copy "$DIRECTORY" "$REMOTE/$(basename $DIRECTORY)/" \ +rclone copy "$DIRECTORY" "$REMOTE/$DESTINATION_DIRECTORY" \ --include "omarchy.*" \ --checksum --copy-links -v -print_success "Sync complete!" +print_success "sync complete!"