Revision 377ec17dba0fc91a33c60c1c3705f9b905ab4f0f authored by Martin.Riener on 25 October 2012, 13:30:55 UTC, committed by Martin.Riener on 25 October 2012, 13:30:55 UTC
git-svn-id: http://gapt.googlecode.com/svn/trunk/source@1267 85d21ef8-add0-11de-ae77-5bfb9c5a3f34
1 parent bd9a213
Raw File
cli.sh
#!/usr/bin/env bash

# searches the actual $PATH, local directory and its development subpath for 
# the CLI jar package and runs the scala interpreter
# (preference is given to the development version)

export JARNAME="cli-1.0-SNAPSHOT-jar-with-dependencies.jar"
export SCP=""
export POSSIBLE_PATHS=`echo $PATH | sed s/:/\\ /g`

for I in ${POSSIBLE_PATHS} .; do
    if test -f $I/${JARNAME};
    then
	export SCP=$I
	break
    fi
done

for I in ${POSSIBLE_PATHS} .; do
    if test -f $I/cli/target/${JARNAME};
    then
	export SCP="$I/cli/target"
	break
    fi
done

if test _${SCP}_ = __ ; then 
    echo "Could not find ${JARNAME}!"
else
    echo found ${JARNAME} in ${SCP}!
    export JAVA_OPTS="-Xss2m -Xmx2g"
    #scala -classpath ${SCP}/${JARNAME} -i cli-script.scala
    $JAVA_HOME/bin/java -jar ${SCP}/${JARNAME}
    # workaround because jline somehow mixes up the terminal
    reset
fi
back to top