# HG changeset patch # User Mike Becker # Date 1706444522 -3600 # Node ID cb128bae116107ab66b1de81b8a496b5ad19bc9a # Parent 21a6cf841d600cf781478754c040439a3a26ceee add shortcut for installation to home diff -r 21a6cf841d60 -r cb128bae1161 dist.src/install.sh --- 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=]" - echo - echo "Default PREFIX: /usr/local" + echo "Usage:" + echo " $0 [PREFIX=]" + 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." #