summaryrefslogtreecommitdiff
path: root/src/lib/config.sync.source.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/config.sync.source.sh')
-rw-r--r--src/lib/config.sync.source.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/lib/config.sync.source.sh b/src/lib/config.sync.source.sh
new file mode 100644
index 0000000..d2256d3
--- /dev/null
+++ b/src/lib/config.sync.source.sh
@@ -0,0 +1,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
+}