summaryrefslogtreecommitdiff
path: root/src/lib/config.sync.source.sh
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-06-11 22:31:55 +0300
committerPaul Buetow <paul@buetow.org>2026-06-11 22:31:55 +0300
commit44d3f7a689751633f8ac5f06b4ba0be8c056bb42 (patch)
tree8957632b4e4af3fec8724858f6196392dd06a05d /src/lib/config.sync.source.sh
parente6c32dd8d134b0f90a144fd415585c0b12ce0d74 (diff)
Split config module concerns for task 9m0
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
+}