ports/devel/maven-wrapper/files/mvn.sh.in
Herve Quiroz 9a416ea0cc Fix the quoting of command-line arguments in the wrapper script
PR:		ports/173146
Reported by:	swills
Feature safe:	yes
2012-11-04 21:39:41 +00:00

29 lines
607 B
Bash

#!/bin/sh
#
# $FreeBSD$
set -e
if [ -f "%%PREFIX%%/etc/maven/setenv.sh" ] ; then
. "%%PREFIX%%/etc/maven/setenv.sh"
fi
if [ -z "${M2_HOME}" ] ; then
INSTANCES_DIRECTORY="/usr/local/etc/maven-wrapper/instances.d"
INSTANCE="`%%FIND%% -s "${INSTANCES_DIRECTORY}" -type f -mindepth 1 -maxdepth 1 | %%TAIL%% -n 1`"
if [ -z "${INSTANCE}" ] ; then
echo "could not find a Maven instance! (${INSTANCES_DIRECTORY})" >&2
exit 1
fi
M2_HOME="`%%CAT%% "${INSTANCE}"`"
if [ ! -d "${M2_HOME}" ] ; then
echo "not a directory: ${M2_HOME}" >&2
exit 2
fi
fi
export M2_HOME
exec "${M2_HOME}/bin/mvn" "$@"