#!/bin/sh

# What directory is this script in?
here=`dirname "$0"`

# Check that this script is there
if [ -f $here/ix-env ]
then
    # Yes - set ix_base accordingly
    ix_base="$here/.."
    echo "ix_base=$ix_base"
else
    # No - tell the user
    echo "Can't determine I-X base; tried relative to $here"
    exit 1
fi

export ix_base

# Start with java directory in the class path.

cpath=java

# Put all .jar files in ../imports/classes in the class path.

cpath=$cpath:`echo ../imports/classes/*.jar | tr " " ":"`

# Now run with new classpath entries before any existing ones.

env CLASSPATH=$cpath:$CLASSPATH "$@"
