Remove unnecessary if-statement.

This commit is contained in:
Nicolás A. Ortega Froysa 2022-11-10 19:22:24 +01:00
parent fc50e669a5
commit 1d1406bb2b

View File

@ -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<n>' where <n> 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<n>' where <n> 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/;;