#!/bin/sh
SDL_SINGLEDISPLAY=1
SDL_ENABLEAPPEVENTS=1
REDECLIPSE_ORIGPW=`pwd`
REDECLIPSE_APPDIR=$(dirname "$0")
cd "${REDECLIPSE_APPDIR}"
if [ -e "../Resources/readme.txt" ]; then
    cd "../Resources"
    REDECLIPSE_RESDIR=`pwd`
    osascript -e "tell application \"Terminal\" to do script \"cd \\\"${REDECLIPSE_RESDIR}\\\"; ./redeclipse.sh $@; exit\""
elif [ -e "../../../../readme.txt" ]; then
    cd "../../../.."
    REDECLIPSE_RESDIR=`pwd`
    osascript -e "tell application \"Terminal\" to do script \"cd \\\"${REDECLIPSE_RESDIR}\\\"; ./redeclipse.sh $@; exit\""
elif [ -e "redeclipse_universal" ]; then
    osascript -e "tell application \"Terminal\" to do script \"./redeclipse_universal $@; exit\""
fi
cd "${REDECLIPSE_ORIGPW}"
