summaryrefslogtreecommitdiff
path: root/src/lib/config.sync.source.sh
blob: d2256d3bc5bae9a9bf1a7c6e4255082ea8a41ac7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
sync_dist() {
    local destination
    local -a rsync_args=(-av)
    local -a sync_destinations=()

    resolve_sync_destinations sync_destinations

    if [ "${SYNC_DELETE:-yes}" = yes ]; then
        rsync_args+=(--delete)
    fi

    for destination in "${sync_destinations[@]}"; do
        log_info "Syncing $DIST_DIR/ to $destination"
        rsync "${rsync_args[@]}" "$DIST_DIR/" "$destination"
    done
}