From f4f8e15bf196c41eb74d63d8263071824e5ce315 Mon Sep 17 00:00:00 2001 From: Emile Clark-Boman Date: Wed, 6 Aug 2025 19:01:06 +1000 Subject: [PATCH] fix SRV_ARGS should be declared as an array --- serve | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/serve b/serve index 7bd348c..8b35a1a 100755 --- a/serve +++ b/serve @@ -9,7 +9,7 @@ PORT="8000" # bind port WEBROOT="www" # root web directory USE_INDEX=true NO_CACHE=true -SRV_ARGS="" +declare -a SRV_ARGS=() SCSS_PATH="$WEBROOT/scss" CSS_PATH="$WEBROOT/css" @@ -21,21 +21,21 @@ function watch_scss { sass --watch "$SCSS_PATH:$CSS_PATH" } -function host ( - local args="$SRV_ARGS" +function host { + local args=$@ # Apply Flags if [[ "$NO_CACHE" == true ]]; then - args+=" --nocache" + args+=("--nocache") fi if [[ "$USE_INDEX" == true ]]; then - args+=" --index" + args+=("--index") fi # Apply Options - args+=" --ip \"$ADDR\" --port \"$PORT\"" + args+=(--ip "$ADDR" --port "$PORT") simple-http-server $args $@ -- "$WEBROOT" -) +} set -ueo pipefail set -x