dist/install.sh

Sun, 16 Jul 2023 13:29:41 +0200

author
Mike Becker <universe@uap-core.de>
date
Sun, 16 Jul 2023 13:29:41 +0200
changeset 25
f061eecae302
parent 24
e7c0b50468ee
child 26
0a5e13216803
permissions
-rwxr-xr-x

fix default prefix in help text not being the default but the actual prefix

fixes #272

#!/bin/sh

PREFIX=/usr/local

# help text
printhelp()
{
	echo "Usage: $0 [PREFIX=<path>]"
	echo
	echo "Default PREFIX: /usr/local"
}

#
# parse arguments 
#
for arg in "$@"
do
    case "$arg" in
		"PREFIX="*)         PREFIX=${arg#PREFIX=} ;;
		"--help"*)          printhelp; exit 1 ;;
		"-"*) echo "unknown option: $arg"; exit 1 ;;
	esac
done

echo "mkdir -p $PREFIX/lib/uwproj"
mkdir -p "$PREFIX/lib/uwproj"

echo "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 $PREFIX/bin"
sed "s:%%PREFIX%%:$PREFIX:g" "bin/uwproj" > "$PREFIX/bin/uwproj"

mercurial