From 552e0049b281ba85c387632bb5e8d3a78ed9d806 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Thu, 8 Oct 2015 17:57:09 +0200 Subject: [PATCH] dist.sh is now generic and can be easily distributed. You should now use it for EJB projects as the EJB jar will be copied to (my system specs, will be improved later on) a Glassfish domain's "lib" directory. I do this here for easy local deployment (not in-place). MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- dist.sh | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/dist.sh b/dist.sh index 3c40b88..f48251e 100755 --- a/dist.sh +++ b/dist.sh @@ -1,10 +1,23 @@ #!/bin/sh -NAME="jshop-receipt-lib" +NAME="${PWD##*/}" +DIST="dist/${NAME}.jar" LIST=`find ../*/lib/${NAME}.jar` LIST="${LIST} `find ../*/*-ejb/lib/${NAME}.jar`" +LIST="${LIST} ${HOME}/gf_domains/domain1/lib/" -for entry in ${LIST}; +for target in ${LIST}; do - cp -v dist/${NAME}.jar ${entry} + if [ ! -f "${DIST}" ] + then + echo "$0: '${DIST}' not found." + elif [ -d "${target}" ] + then + cp -v "${DIST}" "${target}" + elif [ -f "${target}" ] + then + cp -v "${DIST}" "${target}" + else + echo "$0: Target '${target}' not found." + fi done -- 2.39.5