diff options
Diffstat (limited to 'src/lib/config.sync.source.sh')
| -rw-r--r-- | src/lib/config.sync.source.sh | 23 |
1 files changed, 23 insertions, 0 deletions
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) |
