Sun, 28 Jan 2024 13:22:02 +0100
add shortcut for installation to home
dist.src/install.sh | file | annotate | diff | comparison | revisions |
--- a/dist.src/install.sh Sat Jan 27 14:29:52 2024 +0100 +++ b/dist.src/install.sh Sun Jan 28 13:22:02 2024 +0100 @@ -5,9 +5,12 @@ # help text printhelp() { - echo "Usage: $0 [PREFIX=<path>]" - echo - echo "Default PREFIX: /usr/local" + echo "Usage:" + echo " $0 [PREFIX=<path>]" + echo " $0 home" + echo + echo "Default PREFIX: /usr/local" + echo "With 'home' shortcut, PREFIX: $HOME/.local" } # error function @@ -18,15 +21,16 @@ } # -# parse arguments +# parse arguments # for arg in "$@" do case "$arg" in - "PREFIX="*) PREFIX=${arg#PREFIX=} ;; - "--help"*) printhelp; exit 1 ;; - "-"*) echo "unknown option: $arg"; exit 1 ;; - esac + "PREFIX="*) PREFIX=${arg#PREFIX=} ;; + "--help"*) printhelp; exit 1 ;; + "home"*) PREFIX="$HOME/.local" ;; + "-"*) echo "unknown option: $arg"; exit 1 ;; + esac done # @@ -39,8 +43,8 @@ # # install the JAR file # -echo "cp ../target/uwproj-${project.version}-jar-with-dependencies.jar $PREFIX/lib/uwproj/uwproj-${project.version}.jar" -cp "../target/uwproj-${project.version}-jar-with-dependencies.jar" "$PREFIX/lib/uwproj/uwproj-${project.version}.jar" \ +echo "cp ../target/uwproj-0.2.0-SNAPSHOT-jar-with-dependencies.jar $PREFIX/lib/uwproj/uwproj-0.2.0-SNAPSHOT.jar" +cp "../target/uwproj-0.2.0-SNAPSHOT-jar-with-dependencies.jar" "$PREFIX/lib/uwproj/uwproj-0.2.0-SNAPSHOT.jar" \ || exit_on_error "Installing JAR file failed." #