Account for multiple subdirectories for syncing
This commit is contained in:
+7
-5
@@ -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!"
|
||||
|
||||
Reference in New Issue
Block a user