diff options
-rwxr-xr-x | vienna | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/vienna b/vienna index ca35c39..03d7451 100755 --- a/vienna +++ b/vienna | |||
@@ -103,6 +103,13 @@ main() { | |||
103 | # to use the default configuration. | 103 | # to use the default configuration. |
104 | log error "Can't find configuration \`$CONFIG'." | 104 | log error "Can't find configuration \`$CONFIG'." |
105 | exit 2 | 105 | exit 2 |
106 | else | ||
107 | print >&2 "I'm not sure this is a \`vienna' site directory." | ||
108 | if yornp "Initialize? (y/N)"; then | ||
109 | initialize | ||
110 | else | ||
111 | yornp "Continue building? (y/N)" || exit 2 | ||
112 | fi | ||
106 | fi | 113 | fi |
107 | # Further argument processing --- pre-build | 114 | # Further argument processing --- pre-build |
108 | preprocess "$@" || shift | 115 | preprocess "$@" || shift |
@@ -298,6 +305,16 @@ print() { | |||
298 | printf '%s\n' "$*" | 305 | printf '%s\n' "$*" |
299 | } | 306 | } |
300 | 307 | ||
308 | yornp() { # yornp PROMPT | ||
309 | printf >&2 '%s \n' "$@" | ||
310 | read -r yn | ||
311 | case "$yn" in | ||
312 | [Nn]*) return 1 ;; | ||
313 | [Yy]*) return 0 ;; | ||
314 | *) return 2 ;; | ||
315 | esac | ||
316 | } | ||
317 | |||
301 | ### File processing | 318 | ### File processing |
302 | 319 | ||
303 | ## Building block functions | 320 | ## Building block functions |