From d4971998edae804c39797486be7a342d43e61e5c Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 13 Jun 2026 10:15:20 +0300 Subject: Refactor helper modules for im0 --- src/lib/config.sync.source.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src/lib/config.sync.source.sh') diff --git a/src/lib/config.sync.source.sh b/src/lib/config.sync.source.sh index b9362ac..68bb759 100644 --- a/src/lib/config.sync.source.sh +++ b/src/lib/config.sync.source.sh @@ -1,3 +1,26 @@ +resolve_sync_destinations() { + local -n destinations_ref="$1"; shift + local destinations_decl + + destinations_ref=() + + if ! destinations_decl=$(declare -p SYNC_DESTINATIONS 2>/dev/null); then + return + fi + + case "$destinations_decl" in + declare\ -a*\ SYNC_DESTINATIONS=*) + destinations_ref=("${SYNC_DESTINATIONS[@]}") + ;; + *) + if [ -n "${SYNC_DESTINATIONS:-}" ]; then + # shellcheck disable=SC2034 + read -r -a destinations_ref <<< "$SYNC_DESTINATIONS" + fi + ;; + esac +} + sync_dist() { local destination local -a rsync_args=(-av) -- cgit v1.2.3