summaryrefslogtreecommitdiff
path: root/src/shuriken.default.conf
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-06-17 21:00:43 +0300
committerPaul Buetow <paul@buetow.org>2026-06-17 21:00:43 +0300
commit5ebee8ef2a54b8578daf47b17fa82fc85b2cd1cd (patch)
tree90ae7da157de5936b8753f88da80ffa1ac5527fc /src/shuriken.default.conf
parent50d951ab3bb28861b34bc190911dd76bfb93e71c (diff)
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 <noreply@anthropic.com>
Diffstat (limited to 'src/shuriken.default.conf')
-rw-r--r--src/shuriken.default.conf3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/shuriken.default.conf b/src/shuriken.default.conf
index 9d0b1a8..d71ef8e 100644
--- a/src/shuriken.default.conf
+++ b/src/shuriken.default.conf
@@ -42,6 +42,9 @@ TAR_OPTS=(-c)
# Destinations for `shuriken --sync`. Each destination is passed to rsync
# with DIST_DIR/ as the source, so the generated contents are copied into the
# target directory. Sync deletes removed files from destinations by default.
+# SYNC_DESTINATIONS must be a Bash array, even for a single destination, e.g.
+# SYNC_DESTINATIONS=( '/path/with spaces/' ). A scalar string is rejected with
+# an error because word-splitting would break destinations containing spaces.
SYNC_DELETE=yes
SYNC_DESTINATIONS=(
# admin@fishfinger.buetow.org:/var/www/htdocs/example.org/