#!/bin/sh
script_full_path=${0}
script_folder="${script_full_path%/*}"
debugger_full_path="${script_folder}/RexxDebugger.rex"
path_to_rexxjh=$(which rexxjh.sh)
path_to_rexxj=$(which rexxj.sh)
path_to_rexx=$(which rexx)
os_platform=$(uname)
if [ -x "$path_to_rexx" ]; then
  if [ "$os_platform" = "Darwin" ] ; then
    if [ -x "$path_to_rexxjh" ] ; then
      $path_to_rexxjh "$debugger_full_path" $*
    elif [ -x "$path_to_rexxj" ] ; then
      $path_to_rexxj "$debugger_full_path" $*
    else
      echo "Error: Unable to locate bsf4oorexx installation"
    fi
  elif [ -x "$path_to_rexxj" ] || [ -x "$path_to_rexxjh" ]; then
    $path_to_rexx "$debugger_full_path" $*
  else
    echo "Error: Unable to locate bsf4oorexx installation"
  fi
else 
  echo "Error: Unable to locate rexx installation"
fi  

