Allow deleting of branches before anything is pulled
[jprojects-scripts.git] / dist.sh
diff --git a/dist.sh b/dist.sh
index 0bdc4a4..58d917f 100755 (executable)
--- a/dist.sh
+++ b/dist.sh
@@ -19,14 +19,16 @@ WILDFLY_MODULE_XML_FILE="wildfly/module.xml"
 GLASSFISH_BASE_PATH="${HOME}/gf_domain/domain/lib"
 
 # Remote Glassfish path
-GLASSFISH_SSH_PATH="/var/glassfish/domains/domain1/lib"
+GLASSFISH_SSH_PATH="/var/payara/domains/domain1/lib"
 
 # Remote SSH server (password-less access)
 GLASSFISH_SSH_SERVER="www.mxchange.org"
 
+# Windows personal domain
+PERSONAL_DOMAIN_PATH="${HOME}/personal_domain/lib"
+
 # Generate list
 LIST=`find ../*/lib/${NAME}.jar`
-LIST="${LIST} `find ../*/*-ejb/lib/${NAME}.jar`"
 LIST="${LIST} ${WILDFLY_MODULE_PATH}"
 
 if [ -d "${GLASSFISH_BASE_PATH}" ]
@@ -35,6 +37,12 @@ then
        LIST="${LIST} ${GLASSFISH_BASE_PATH}"
 fi
 
+if [ -d "${PERSONAL_DOMAIN_PATH}" ]
+then
+       echo "$0: Personal domain found, adding to LIST ..."
+       LIST="${LIST} ${PERSONAL_DOMAIN_PATH}"
+fi
+
 if [ ! -f "${DIST}" ]
 then
        echo "$0: '${DIST}' not found."
@@ -42,27 +50,26 @@ then
 elif [ ! -d "${WILDFLY_MODULE_BASE_PATH}" ]
 then
        echo "$0: WildFly base path '${WILDFLY_MODULE_BASE_PATH}' not created."
-       exit 1
 elif [ ! -d "${WILDFLY_MODULE_PATH}" ]
 then
        mkdir -vp "${WILDFLY_MODULE_PATH}"
 fi
 
-for target in ${LIST};
+for project in ${LIST};
 do
-       if [ -d "${target}" ]
+       if [ -d "${project}" ]
        then
-               cp -v "${DIST}" "${target}"
-       elif [ -f "${target}" ]
+               cp -v "${DIST}" "${project}"
+       elif [ -f "${project}" ]
        then
-               cp -v "${DIST}" "${target}"
+               cp -v "${DIST}" "${project}"
        else
-               echo "$0: Target '${target}' not found."
+               echo "$0: Project '${project}' not found."
        fi
 
 done
 
-if [ -n "${GLASSFISH_SSH_PATH}" -a -n "${GLASSFISH_SSH_SERVER}" ]
+if [ "$1" != "r" -a -n "${GLASSFISH_SSH_PATH}" -a -n "${GLASSFISH_SSH_SERVER}" ]
 then
        echo "$0: Copying to remote '${GLASSFISH_SSH_SERVER}' ..."
        scp "${DIST}" "${GLASSFISH_SSH_SERVER}:${GLASSFISH_SSH_PATH}"