#!/bin/sh
APP_PATH=`echo $0 | awk '{split($0,patharr,"/"); idx=1; while(patharr[idx+3] != "") { if (patharr[idx] != "/") {printf("%s/", patharr[idx]); idx++ }} }'`
NAME=`basename "$APP_PATH" .app`
cd "${APP_PATH}/Contents/MacOS"

if [ -f "$NAME" ]; then rm -f "$NAME" ; fi
if !(ln `which mono` "$NAME"); then
	ln -s `which mono` "$NAME"
fi

cd ../Resources
export PATH="$PATH:/usr/local/bin"
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/lib/pkgconfig:/usr/local/lib/pkgconfig"

"../MacOS/$NAME" --desktop --debug continuum.exe $@
