blob: c7155acb64c0fe5af72d89be447455e8cb7da7b6 [file] [log] [blame]
Jonathan Hartfe990382013-02-06 15:22:32 -08001#!/bin/bash
2
3CP=$( echo `dirname $0`/../lib/*.jar `dirname $0`/../lib/titan/*.jar . | sed 's/ /:/g')
4
5# Find Java
6if [ "$JAVA_HOME" = "" ] ; then
7 JAVA="java -server"
8else
9 JAVA="$JAVA_HOME/bin/java -server"
10fi
11
12# Set Java options
13if [ "$JAVA_OPTIONS" = "" ] ; then
14 JAVA_OPTIONS="-Xms32m -Xmx512m"
15fi
16
17# Launch the application
18if [ "$1" = "-e" ]; then
19 k=$2
20 if [ $# -gt 2 ]; then
21 for (( i=3 ; i < $# + 1 ; i++ ))
22 do
23 eval a=\$$i
24 k="$k \"$a\""
25 done
26 fi
27
28 eval $JAVA $JAVA_OPTIONS -cp $CP:$CLASSPATH com.thinkaurelius.titan.tinkerpop.gremlin.ScriptExecutor $k
29else
30 if [ "$1" = "-v" ]; then
31 $JAVA $JAVA_OPTIONS -cp $CP:$CLASSPATH com.tinkerpop.gremlin.Version
32 else
33 $JAVA $JAVA_OPTIONS -cp $CP:$CLASSPATH com.thinkaurelius.titan.tinkerpop.gremlin.Console
34 fi
35fi
36
37# Return the program's exit code
38exit $?