You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by sp...@apache.org on 2019/04/03 18:40:18 UTC

[tinkerpop] branch master updated: TINKERPOP-2180: Make sure user.working_dir is still respected properly

This is an automated email from the ASF dual-hosted git repository.

spmallette pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git


The following commit(s) were added to refs/heads/master by this push:
     new 9334272  TINKERPOP-2180: Make sure user.working_dir is still respected properly
     new 32f6c6a  Merge branch 'tp33'
9334272 is described below

commit 9334272171ecddc0ec890f4ebe7e39ef1ad5339c
Author: Eduard Tudenhoefner <ed...@datastax.com>
AuthorDate: Wed Apr 3 18:44:36 2019 +0200

    TINKERPOP-2180: Make sure user.working_dir is still respected properly
---
 gremlin-console/src/main/bin/gremlin.sh | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/gremlin-console/src/main/bin/gremlin.sh b/gremlin-console/src/main/bin/gremlin.sh
index 6253ee1..b12983f 100755
--- a/gremlin-console/src/main/bin/gremlin.sh
+++ b/gremlin-console/src/main/bin/gremlin.sh
@@ -92,15 +92,20 @@ while getopts ":l" opt; do
     esac
 done
 
-JAVA_OPTIONS="${JAVA_OPTIONS} -Duser.working_dir=${USER_DIR} -Dtinkerpop.ext=${USER_EXT_DIR:-${SYSTEM_EXT_DIR}} -Dlog4j.configuration=conf/log4j-console.properties -Dgremlin.log4j.level=$GREMLIN_LOG_LEVEL"
-JAVA_OPTIONS=$(awk -v RS=' ' '!/^$/ {if (!x[$0]++) print}' <<< "${JAVA_OPTIONS}" | grep -v '^$' | paste -sd ' ' -)
+JVM_OPTS=()
+if [ ! -z "${JAVA_OPTIONS}" ]; then
+    JVM_OPTS+=( "${JAVA_OPTIONS}" )
+fi
+
+JVM_OPTS+=( "-Duser.working_dir=${USER_DIR}" "-Dtinkerpop.ext=${USER_EXT_DIR:-${SYSTEM_EXT_DIR}}" "-Dlog4j.configuration=conf/log4j-console.properties" "-Dgremlin.log4j.level=$GREMLIN_LOG_LEVEL" )
+JVM_OPTS=$(awk -v RS=' ' '!/^$/ {if (!x[$0]++) print}' <<< "${JVM_OPTS}" | grep -v '^$' | paste -sd ' ' -)
 
 if [ -n "$SCRIPT_DEBUG" ]; then
     # in debug mode enable debugging of :install command
-    JAVA_OPTIONS="${JAVA_OPTIONS} -Divy.message.logger.level=4 -Dgroovy.grape.report.downloads=true"
+    JVM_OPTS="${JAVA_OPTIONS} -Divy.message.logger.level=4 -Dgroovy.grape.report.downloads=true"
     echo "CLASSPATH: $CLASSPATH"
     set -x
 fi
 
 # Start the JVM, execute the application, and return its exit code
-exec $JAVA "$JAVA_OPTIONS" org.apache.tinkerpop.gremlin.console.Console "$@"
+exec $JAVA "${JVM_OPTS[@]}" org.apache.tinkerpop.gremlin.console.Console "$@"