From 1d1406bb2b0db5f419a3795af3008dbe93c7f3ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20A=2E=20Ortega=20Froysa?= Date: Thu, 10 Nov 2022 19:22:24 +0100 Subject: [PATCH] Remove unnecessary if-statement. --- isidore.sh | 39 ++++++++++++++++++--------------------- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/isidore.sh b/isidore.sh index 071fd95..4072372 100755 --- a/isidore.sh +++ b/isidore.sh @@ -260,28 +260,25 @@ case $1 in build) VERBOSE=0 JOBS=1 - if [ $# -gt 1 ] - then - for i in ${@:2} - do - case $i in - -v) - VERBOSE=1;; - -j*) - if ! [[ "$i" =~ ^-j[0-9]+$ ]] - then - echo "Argument '$i' badly formatted. Should be '-j' where is a number." - print_usage - exit 1 - fi - JOBS=${i:2};; - *) - echo "Unknown argument for build '$i'. Use the 'help' subcommand." + for i in ${@:2} + do + case $i in + -v) + VERBOSE=1;; + -j*) + if ! [[ "$i" =~ ^-j[0-9]+$ ]] + then + echo "Argument '$i' badly formatted. Should be '-j' where is a number." print_usage - exit 1;; - esac - done - fi + exit 1 + fi + JOBS=${i:2};; + *) + echo "Unknown argument for build '$i'. Use the 'help' subcommand." + print_usage + exit 1;; + esac + done build_project $VERBOSE $JOBS;; serve|server) php -S localhost:8080 -t $OUTPUT_DIR/;;