diff options
author | Case Duckworth | 2023-01-09 00:00:21 -0600 |
---|---|---|
committer | Case Duckworth | 2023-01-09 00:00:21 -0600 |
commit | b6a0b340ceb01b8636be84a29d216cab8961e039 (patch) | |
tree | 9fff1ce36d4a2f608c0d712ce25219debd5dc469 | |
parent | Add $PHTML_OPTIONS (diff) | |
download | vienna-b6a0b340ceb01b8636be84a29d216cab8961e039.tar.gz vienna-b6a0b340ceb01b8636be84a29d216cab8961e039.zip |
Move preprocess
-rwxr-xr-x | vienna | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/vienna b/vienna index e1263ea..bd63a3e 100755 --- a/vienna +++ b/vienna | |||
@@ -92,8 +92,6 @@ main() { | |||
92 | shift "$((OPTIND - 1))" | 92 | shift "$((OPTIND - 1))" |
93 | # Prepare | 93 | # Prepare |
94 | cd "$WORKDIR" || exit 2 | 94 | cd "$WORKDIR" || exit 2 |
95 | # Further argument processing --- pre-build | ||
96 | preprocess "$@" || shift | ||
97 | # Source config | 95 | # Source config |
98 | if test -f "$CONFIG"; then | 96 | if test -f "$CONFIG"; then |
99 | # Source ./.vienna.sh, if it exists. | 97 | # Source ./.vienna.sh, if it exists. |
@@ -113,6 +111,8 @@ main() { | |||
113 | yornp "Continue building? (y/N)" || exit 2 | 111 | yornp "Continue building? (y/N)" || exit 2 |
114 | fi | 112 | fi |
115 | fi | 113 | fi |
114 | # Further argument processing --- pre-build | ||
115 | preprocess "$@" || shift | ||
116 | log vienna config | 116 | log vienna config |
117 | # Log configuration variables | 117 | # Log configuration variables |
118 | log config 'base url': "$URL_ROOT" | 118 | log config 'base url': "$URL_ROOT" |
@@ -150,10 +150,6 @@ main() { | |||
150 | } | 150 | } |
151 | 151 | ||
152 | preprocess() { | 152 | preprocess() { |
153 | case "$*" in | ||
154 | *preview*) DOMAIN=http://localhost:${VIENNA_PREVIEW_PORT:-8000} ;; | ||
155 | esac | ||
156 | |||
157 | case "${1:-ok}" in | 153 | case "${1:-ok}" in |
158 | ok) ;; | 154 | ok) ;; |
159 | init) | 155 | init) |
@@ -210,7 +206,7 @@ directory that tells me what to do. | |||
210 | EOF | 206 | EOF |
211 | exit 3 | 207 | exit 3 |
212 | } | 208 | } |
213 | alias publish=_publish | 209 | publish() { _publish; } |
214 | 210 | ||
215 | _preview() { | 211 | _preview() { |
216 | cat <<EOF >&2 | 212 | cat <<EOF >&2 |
@@ -225,7 +221,7 @@ in this directory that tells me what to do. | |||
225 | EOF | 221 | EOF |
226 | exit 3 | 222 | exit 3 |
227 | } | 223 | } |
228 | alias preview=_preview | 224 | preview() { _preview; } |
229 | 225 | ||
230 | initialize() { # initialize | 226 | initialize() { # initialize |
231 | log init "$CONFIG" | 227 | log init "$CONFIG" |