From 5ebee8ef2a54b8578daf47b17fa82fc85b2cd1cd Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Wed, 17 Jun 2026 21:00:43 +0300 Subject: an0 reject scalar SYNC_DESTINATIONS instead of word-splitting it A scalar SYNC_DESTINATIONS containing spaces was word-split by the shared resolve_config_array helper, breaking a single destination into multiple broken arguments passed to rsync. A list of rsync destinations is inherently a list, and array syntax is the only spelling that preserves embedded spaces. resolve_sync_destinations now detects a scalar declaration via declare -p and fails with a clear config_error telling the user to use array syntax. The array path is unchanged, and resolve_config_array's scalar word-splitting is left intact for TAR_OPTS (where turning "-c -v" into separate options is desired). Adds focused tests proving the scalar case errors without invoking rsync and the array case preserves a space-containing destination as one argument. Updates src/shuriken.default.conf and README.md to document the requirement. Co-Authored-By: Claude Opus 4.8 --- README.md | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'README.md') diff --git a/README.md b/README.md index 9e9dc81..b853260 100644 --- a/README.md +++ b/README.md @@ -204,6 +204,11 @@ SYNC_DESTINATIONS=( ) ``` +`SYNC_DESTINATIONS` must be a Bash array, even for a single destination (for +example `SYNC_DESTINATIONS=( '/path/with spaces/' )`). A scalar string is +rejected with an error, since word-splitting would break destinations that +contain spaces. + `--sync` runs `rsync -av --delete "$DIST_DIR/" "$destination"` for each destination by default. The trailing slash on `DIST_DIR/` means the generated contents are copied into the target directory. Set `SYNC_DELETE=no` or pass -- cgit v1.2.3