From a618eac71b9f103f5e3a10a86ee923f6e78af185 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Thu, 29 Sep 2022 13:33:56 -0500 Subject: Add more logging --- vienna | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/vienna b/vienna index 31c46c7..7c8f722 100755 --- a/vienna +++ b/vienna @@ -65,6 +65,10 @@ configure() { *) exit 1 ;; esac done + ## Log configuration variables + echo >&2 "[config] domain: $DOMAIN" + echo >&2 "[config] workdir: $WORKD" + echo >&2 "[config] output: $OUTD" ## Initialize state FILE= ## Cleanup after we're done @@ -80,8 +84,13 @@ main() { configure "$@" shift "$((OPTIND - 1))" # Further argument processing --- pre-build - case "$1" in - clean) rm -r "$OUTD" ;; + case "${1:-ok}" in + ok) ;; + clean) + echo >&2 "[vienna] clean" + rm -r "$OUTD" + exit + ;; esac # Prepare cd "$WORKD" || exit 2 @@ -102,8 +111,20 @@ main() { # Copy static files static * || exit 2 # Further argument processing --- post-build - case "$1" in - publish) publish "$OUTD" ;; + case "${1:-ok}" in + ok) ;; + publish) + echo >&2 "[vienna] publish" + publish "$OUTD" + ;; + preview) + echo >&2 "[vienna] preview" + preview "$OUTD" + ;; + *) + echo >&2 "[vienna] Don't know command \`$1'." + exit 1 + ;; esac } -- cgit 1.4.1-21-gabe81