This is an automated email from the ASF dual-hosted git repository.
xiazcy pushed a commit to branch 3.7-dev
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git
The following commit(s) were added to refs/heads/3.7-dev by this push:
new 39f24f5640 Updated gremlin-server.sh to allow spaces in working
directory (#3020)
39f24f5640 is described below
commit 39f24f564040a764b564c5abc3ada2e6e09f4352
Author: Flora Jin <[email protected]>
AuthorDate: Fri Feb 21 15:09:15 2025 -0800
Updated gremlin-server.sh to allow spaces in working directory (#3020)
---
CHANGELOG.asciidoc | 1 +
gremlin-server/src/main/bin/gremlin-server.sh | 10 +++++-----
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 40fd19e1b9..13b986fa12 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -35,6 +35,7 @@
image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
* Fixed issue in `gremlin-console` where it couldn't accept plugin files that
included empty lines or invalid plugin names.
* Modified grammar to make `none()` usage more consistent as a filter step
where it can now be used to chain additional traversal steps and be used
anonymously.
* Added missing anonymous support for `disjunct()` in Python and Javascript.
+* Fixed bug in 'gremlin-server.sh' to account for spaces in directory names.
* Deprecated `gremlin_python.process.__.has_key_` in favor of
`gremlin_python.process.__.has_key`.
* Allowed `mergeV()` and `mergeE()` to supply `null` in `Map` values.
diff --git a/gremlin-server/src/main/bin/gremlin-server.sh
b/gremlin-server/src/main/bin/gremlin-server.sh
index b7aebf2513..430a18c398 100755
--- a/gremlin-server/src/main/bin/gremlin-server.sh
+++ b/gremlin-server/src/main/bin/gremlin-server.sh
@@ -43,7 +43,7 @@ GREMLIN_BIN="$(pwd)"
GREMLIN_CONF=$GREMLIN_BIN/gremlin-server.conf
-[[ -r $GREMLIN_CONF ]] && source $GREMLIN_CONF
+[[ -r "$GREMLIN_CONF" ]] && source "$GREMLIN_CONF"
[[ -n "$DEBUG" ]] && set -x
if [[ -z "$GREMLIN_HOME" ]]; then
@@ -96,7 +96,7 @@ fi
# Build Java CLASSPATH
CP="$GREMLIN_HOME/conf/"
-CP="$CP":$( echo $GREMLIN_HOME/lib/*.jar . | sed 's/ /:/g')
+CP="$CP":$( find "$GREMLIN_HOME/lib" -name "*.jar" -print | tr '\n' ':' ).
CP="$CP":$( find -L "$GREMLIN_HOME"/ext -mindepth 1 -maxdepth 1 -type d | \
sort | sed 's/$/\/plugin\/*/' | tr '\n' ':' )
@@ -166,7 +166,7 @@ start() {
exit 1
fi
- $JAVA -Dlogback.configurationFile=$LOGBACK_CONF $JAVA_OPTIONS -cp
$CLASSPATH $GREMLIN_SERVER_CMD "$GREMLIN_YAML" >> "$LOG_FILE" 2>&1 &
+ $JAVA -Dlogback.configurationFile="$LOGBACK_CONF" $JAVA_OPTIONS -cp
"$CLASSPATH" "$GREMLIN_SERVER_CMD" "$GREMLIN_YAML" >> "$LOG_FILE" 2>&1 &
PID=$!
disown $PID
echo $PID > "$PID_FILE"
@@ -209,7 +209,7 @@ startForeground() {
fi
if [[ -z "$RUNAS" ]]; then
- exec $JAVA -Dlogback.configurationFile=$LOGBACK_CONF $JAVA_OPTIONS -cp
$CLASSPATH $GREMLIN_SERVER_CMD "$GREMLIN_YAML"
+ exec $JAVA -Dlogback.configurationFile="$LOGBACK_CONF" $JAVA_OPTIONS -cp
"$CLASSPATH" "$GREMLIN_SERVER_CMD" "$GREMLIN_YAML"
exit 0
else
echo Starting in foreground not supported with RUNAS
@@ -231,7 +231,7 @@ install() {
DEPS="$@"
if [[ -z "$RUNAS" ]]; then
- $JAVA -Dlogback.configurationFile=$LOGBACK_CONF $JAVA_OPTIONS -cp
$CLASSPATH $GREMLIN_INSTALL_CMD $DEPS
+ $JAVA -Dlogback.configurationFile="$LOGBACK_CONF" $JAVA_OPTIONS -cp
"$CLASSPATH" "$GREMLIN_INSTALL_CMD" $DEPS
else
su -c "$JAVA -Dlogback.configurationFile=$LOGBACK_CONF $JAVA_OPTIONS -cp
$CLASSPATH $GREMLIN_INSTALL_CMD $DEPS " "$RUNAS"
fi