Sun, 16 Jul 2023 13:10:50 +0200
add missing double-quotes and use lower-case local variable names - fixes #271
dist/install.sh | file | annotate | diff | comparison | revisions |
--- a/dist/install.sh Sat Jul 15 13:13:36 2023 +0200 +++ b/dist/install.sh Sun Jul 16 13:10:50 2023 +0200 @@ -13,23 +13,22 @@ # # parse arguments # -for ARG in $@ +for arg in "$@" do - case "$ARG" in - "PREFIX="*) PREFIX=${ARG#PREFIX=} ;; + case "$arg" in + "PREFIX="*) PREFIX=${arg#PREFIX=} ;; "--help"*) printhelp; exit 1 ;; - "-"*) echo "unknown option: $ARG"; exit 1 ;; + "-"*) echo "unknown option: $arg"; exit 1 ;; esac done - echo "mkdir -p /usr/lib/uwproj" -mkdir -p $PREFIX/lib/uwproj +mkdir -p "$PREFIX/lib/uwproj" echo "cp ../target/uwproj-0.1-jar-with-dependencies.jar /usr/lib/uwproj/uwproj-0.1.jar" -cp ../target/uwproj-0.1-jar-with-dependencies.jar $PREFIX/lib/uwproj/uwproj-0.1.jar +cp "../target/uwproj-0.1-jar-with-dependencies.jar" "$PREFIX/lib/uwproj/uwproj-0.1.jar" echo "cp bin/uwproj /usr/bin" -sed s:%%PREFIX%%:$PREFIX:g bin/uwproj > $PREFIX/bin/uwproj +sed "s:%%PREFIX%%:$PREFIX:g" "bin/uwproj" > "$PREFIX/bin/uwproj"