diff options
Diffstat (limited to 'jh-mvn-install.sh')
-rw-r--r-- | jh-mvn-install.sh | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/jh-mvn-install.sh b/jh-mvn-install.sh index ab67594..e3db6ad 100644 --- a/jh-mvn-install.sh +++ b/jh-mvn-install.sh @@ -4,23 +4,28 @@ # terms of the Do What The Fuck You Want To Public License, Version 2, # as published by Sam Hocevar. See the COPYING file for more details. -if [[ $# != 5 ]] && [[ $# != 6 ]]; then +if [[ $# < 4 ]]; then jh-help $0 >>/dev/stderr exit 1 fi base=`jh-mvn-basename $1 $2 $3` -jarfile=$4 -pomfile=$5 -alias=$6 +pomfile=$4 +jarfile=$5 +if shift 5; then + aliases=("$@") +fi dir="${base%/*}" install -d "${DESTDIR}${dir}" -install -m 644 "$jarfile" "${DESTDIR}${base}.jar" -install -m 644 "$pomfile" "${DESTDIR}${base}.pom" +install -m 644 "$jarfile" "${DESTDIR}${base}.pom" +[[ -n $jarfile ]] || exit 0 +install -m 644 "$pomfile" "${DESTDIR}${base}.jar" -if [[ -n $alias ]]; then - link="/usr/share/java/$alias" - install -d "${DESTDIR}${link%/*}" - ln -s "${base}.jar" "${DESTDIR}${link}" +if [[ -n "${aliases[*]}" ]]; then + for alias in "${aliases[@]}"; do + link="/usr/share/java/$alias" + install -d "${DESTDIR}${link%/*}" + ln -s "${base}.jar" "${DESTDIR}${link}" + done fi |