#! /bin/bash

# Check if CK_ROOT is defined and used it, otherwise use auto-detected path
if [ -z "$CK_ROOT" ]; then 
  CK_path1=`dirname $0`
  pushd $CK_path1/.. > /dev/null
  CK_path=`pwd`
  popd > /dev/null
  export CK_ROOT=$CK_path; 
fi

# Check which python to use
if [ -z "$CK_PYTHON" ]; then
   export CK_PYTHON=python
fi

# Load kernel module (either GIT/local installation or as package)
if [ -f "$CK_ROOT/ck/kernel.py" ]; then 
 $CK_PYTHON -W ignore::DeprecationWarning $CK_ROOT/ck/kernel.py "$@"
else
 $CK_PYTHON -m ck.kernel "$@"
fi
