JAL-3820 JAL-3830 improvements to script launching. Icon on macOS. Fixed CLASSPATH.
[jalview.git] / utils / getdown / bin / jalview.sh
index 62da28c..9e3a8c7 100755 (executable)
@@ -65,7 +65,8 @@ CLASSPATH=""
 declare -a JARPATHS=()
 if [ -e "${GETDOWNTXT}" ]; then
   # always check grep and sed regexes on macos -- they're not the same
-  for JAR in $(grep -e '^code\s*=\s*' "${GETDOWNTXT}" | sed -e 's/^code\s*=\s*//;'); do
+for JAR in $(grep -e '^code[[:space:]]*=[[:space:]]*' "${GETDOWNTXT}" | while read -r line; do echo $line | sed -E -e 's/code[[:space:]]*=[[:space:]]*//;'; done);
+  do
     [ -n "${CLASSPATH}" ] && CLASSPATH="${CLASSPATH}:"
     CLASSPATH="${CLASSPATH}${APPDIR}/${JAR}"
     JARPATHS=( "${JARPATHS[@]}" "${APPDIR}/${JAR}" )
@@ -122,6 +123,7 @@ elif command -v resize 2>&1 >/dev/null; then
   COLUMNS=$(resize -u | grep COLUMNS= | sed -e 's/.*=//;s/;//') 2>/dev/null
 fi
 JVMARGS=( "${JVMARGS[@]}" "-DCONSOLEWIDTH=${COLUMNS}" )
+JVMARGS=( "${JVMARGS[@]}" "-Dgetdownappdir=${APPDIR}" )
 
 # Is there a bundled Java?  If not just try one in the PATH (do need .exe in WSL)
 if [ \! -e "${JAVA}" ]; then