#!/bin/bash

if [ "$XIA2_ROOT"=="" ]; then
  full_path="$(cd "${0%/*}" 2>/dev/null; echo "$PWD"/"${0##*/}")"
  export XIA2_ROOT=`dirname "$full_path" | sed 's/\/Applications$//'`
fi

export XIA2HTMLDIR=$XIA2_ROOT/Modules/Xia2html

if [ -n "$XIA2_CCTBX" ]; then 
  ${XIA2_CCTBX}/bin/cctbx.python -Q warn \
    $XIA2HTMLDIR/Xia2html.py ${1+"$@"}
else
  cctbx.python -Q warn $XIA2HTMLDIR/Xia2html.py ${1+"$@"}
fi

