Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix that works even if the path has spaces in the directory name #4167

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions janusgraph-dist/src/assembly/static/bin/gremlin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,26 +36,26 @@ while [ -h "${SCRIPT_NAME}" ]; do
done
BIN="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
# Set $CFG to $BIN/../conf
cd -P $BIN/../conf
cd -P "$BIN/../conf"
CFG=$(pwd)
# Set $LIB to $BIN/../lib
cd -P $BIN/../lib
# Set $LIB to "$BIN/../lib"
cd -P "$BIN/../lib"
LIB=$(pwd)
# Set $LIB to $BIN/../ext
cd -P $BIN/../ext
cd -P "$BIN/../ext"
EXT=$(pwd)
# Initialize classpath to $CFG
CP="$CFG"
# Add the slf4j-log4j12 binding
CP="$CP":$(find -L $LIB -name 'slf4j-log4j12*.jar' | sort | tr '\n' ':')
CP="$CP":$(find -L "$LIB" -name 'slf4j-log4j12*.jar' | sort | tr '\n' ':')
# Add the jars in $BIN/../lib that start with "janusgraph"
CP="$CP":$(find -L $LIB -name 'janusgraph*.jar' | sort | tr '\n' ':')
CP="$CP":$(find -L "$LIB" -name 'janusgraph*.jar' | sort | tr '\n' ':')
# Add the remaining jars in $BIN/../lib.
CP="$CP":$(find -L $LIB -name '*.jar' \
CP="$CP":$(find -L "$LIB" -name '*.jar' \
\! -name 'janusgraph*' \
\! -name 'slf4j-log4j12*.jar' | sort | tr '\n' ':')
# Add the jars in $BIN/../ext (at any subdirectory depth)
CP="$CP":$(find -L $EXT -name '*.jar' | sort | tr '\n' ':')
CP="$CP":$(find -L "$EXT" -name '*.jar' | sort | tr '\n' ':')

cd ..
SYSTEM_EXT_DIR="`pwd`/ext"
Expand Down Expand Up @@ -125,4 +125,4 @@ if [ -n "$SCRIPT_DEBUG" ]; then
fi

# Start the JVM, execute the application, and return its exit code
exec $JAVA $JAVA_OPTIONS $MAIN_CLASS "$@"
exec $JAVA "$JAVA_OPTIONS" $MAIN_CLASS "$@"
8 changes: 4 additions & 4 deletions janusgraph-dist/src/assembly/static/bin/janusgraph-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ COLLECTED_JAVA_OPTIONS_FILE=""

# Read user-defined JVM options from jvm.options file
if [[ -z "$JAVA_OPTIONS_FILE" ]]; then
jver=$($JAVA -version 2>&1 | grep 'version' 2>&1 | awk -F\" '{ split($2,a,"."); print a[1]"."a[2]}')
jver=$("$JAVA" -version 2>&1 | grep 'version' 2>&1 | awk -F\" '{ split($2,a,"."); print a[1]"."a[2]}')
if [[ $jver == "1.8" ]]; then
JAVA_OPTIONS_FILE="$JANUSGRAPH_CONF/jvm-8.options"
else
Expand All @@ -130,11 +130,11 @@ if [[ -z "$CP" ]];then
# Initialize classpath to $JANUSGRAPH_CFG
CP="${JANUSGRAPH_CONF}"
# Add the slf4j-log4j12 binding
CP="$CP":$(find -L $JANUSGRAPH_LIB -name 'slf4j-log4j12*.jar' | sort | tr '\n' ':')
CP="$CP":$(find -L "$JANUSGRAPH_LIB" -name 'slf4j-log4j12*.jar' | sort | tr '\n' ':')
# Add the jars in $JANUSGRAPH_HOME/lib that start with "janusgraph"
CP="$CP":$(find -L $JANUSGRAPH_LIB -name 'janusgraph*.jar' | sort | tr '\n' ':')
CP="$CP":$(find -L "$JANUSGRAPH_LIB" -name 'janusgraph*.jar' | sort | tr '\n' ':')
# Add the remaining jars in $JANUSGRAPH_HOME/lib.
CP="$CP":$(find -L $JANUSGRAPH_LIB -name '*.jar' \
CP="$CP":$(find -L "$JANUSGRAPH_LIB" -name '*.jar' \
\! -name 'janusgraph*' \
\! -name 'slf4j-log4j12*.jar' | sort | tr '\n' ':')
# Add the jars in $BIN/../ext (at any subdirectory depth)
Expand Down
Loading