forked from orientechnologies/orientdb
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgremlin.sh
More file actions
45 lines (39 loc) · 933 Bytes
/
gremlin.sh
File metadata and controls
45 lines (39 loc) · 933 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
case `uname` in
CYGWIN*)
CP=$( echo `dirname $0`/../lib/*.jar . | sed 's/ /;/g')
;;
*)
CP=$( echo `dirname $0`/../lib/*.jar . | sed 's/ /:/g')
esac
#echo $CP
# Find Java
if [ "$JAVA_HOME" = "" ] ; then
JAVA="java"
else
JAVA="$JAVA_HOME/bin/java"
fi
# Set Java options
if [ "$JAVA_OPTIONS" = "" ] ; then
JAVA_OPTIONS="-Xms32m -Xmx512m"
fi
# Launch the application
if [ "$1" = "-e" ]; then
k=$2
if [ $# -gt 2 ]; then
for (( i=3 ; i -lt $# + 1 ; i++ ))
do
eval a=\$$i
k="$k \"$a\""
done
fi
eval "$JAVA" $JAVA_OPTIONS -cp $CP:$CLASSPATH com.tinkerpop.gremlin.groovy.jsr223.ScriptExecutor $k
else
if [ "$1" = "-v" ]; then
"$JAVA" -server $JAVA_OPTIONS -cp $CP:$CLASSPATH com.tinkerpop.gremlin.Version
else
"$JAVA" -server $JAVA_OPTIONS -cp $CP:$CLASSPATH com.tinkerpop.gremlin.groovy.console.Console
fi
fi
# Return the program's exit code
exit $?