summaryrefslogtreecommitdiff
path: root/src/lib/config.print.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.print.source.sh
parente6c32dd8d134b0f90a144fd415585c0b12ce0d74 (diff)
Split config module concerns for task 9m0
Diffstat (limited to 'src/lib/config.print.source.sh')
-rw-r--r--src/lib/config.print.source.sh46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/lib/config.print.source.sh b/src/lib/config.print.source.sh
new file mode 100644
index 0000000..1950a26
--- /dev/null
+++ b/src/lib/config.print.source.sh
@@ -0,0 +1,46 @@
+print_shell_assignment() {
+ local -r name="$1"; shift
+ local -r value="$1"; shift
+
+ printf '%s=%q\n' "$name" "$value"
+}
+
+print_shell_array_assignment() {
+ local -r name="$1"; shift
+ local value
+
+ printf '%s=(' "$name"
+ for value in "$@"; do
+ printf ' %q' "$value"
+ done
+ printf ' )\n'
+}
+
+print_config() {
+ local -a tar_opts=()
+ local -a sync_destinations=()
+
+ resolve_tar_opts tar_opts
+ resolve_sync_destinations sync_destinations
+
+ print_shell_assignment CONFIG_SOURCE "${SHURIKEN_CONFIG_SOURCE:-}"
+ print_shell_assignment INCOMING_DIR "$INCOMING_DIR"
+ print_shell_assignment DIST_DIR "$DIST_DIR"
+ print_shell_assignment TEMPLATE_DIR "$TEMPLATE_DIR"
+ print_shell_assignment TITLE "$TITLE"
+ print_shell_assignment HEIGHT "${HEIGHT:-}"
+ print_shell_assignment THUMBHEIGHT "$THUMBHEIGHT"
+ print_shell_assignment MAXPREVIEWS "$MAXPREVIEWS"
+ print_shell_assignment IMAGE_JOBS "$IMAGE_JOBS"
+ print_shell_assignment IMAGEMAGICK_TIMEOUT "$IMAGEMAGICK_TIMEOUT"
+ print_shell_assignment RANDOM_SEED "${RANDOM_SEED:-}"
+ print_shell_assignment SHUFFLE "${SHUFFLE:-no}"
+ print_shell_assignment SPLASH_PAGE "${SPLASH_PAGE:-yes}"
+ print_shell_assignment TARBALL_INCLUDE "${TARBALL_INCLUDE:-no}"
+ print_shell_assignment TARBALL_SUFFIX "${TARBALL_SUFFIX:-.tar}"
+ print_shell_assignment TAR_TIMEOUT "$TAR_TIMEOUT"
+ print_shell_array_assignment TAR_OPTS "${tar_opts[@]}"
+ print_shell_assignment SYNC_DELETE "${SYNC_DELETE:-yes}"
+ print_shell_array_assignment SYNC_DESTINATIONS "${sync_destinations[@]}"
+ print_shell_assignment ORIGINAL_BASEPATH "${ORIGINAL_BASEPATH:-}"
+}