#!/bin/sh

VIRTUAL_ENV={virtual_env}
export VIRTUAL_ENV

{ld_library_path}
{ld_preload}

if test "x$VIRTUAL_ENV" != "x"; then
  PATH="$VIRTUAL_ENV/bin:$PATH"
  export PATH
  PYTHONHOME="$VIRTUAL_ENV"
  export PYTHONHOME
fi

cp="{install_lib}jep/jep-{version}.jar"
if test "x$CLASSPATH" != "x"; then
    cp="$cp":"$CLASSPATH"
fi

jni_path="{install_lib}jep"

args=$*
if test "x$args" = "x"; then
  args="{install_lib}jep/console.py"
fi

exec java -classpath "$cp" -Djava.library.path="$jni_path" jep.Run $args
