#!/usr/local/bin/bash
# Wrapper to display console error messages on Unixes
PREFIX=`dirname $0`
PREFIX=`dirname $PREFIX`
PREFIX=`dirname $PREFIX`
PREFIX=`dirname $PREFIX`
export MCSTAS=$PREFIX/mcstas/2.5
export MCSTAS_TOOLS=$PREFIX/mcstas/2.5/tools/Perl/
export PATH=$PREFIX/mcstas/2.5/bin:$PATH
UNAME=`uname -s`


ERRMSG=`echo $* | sed s/\ /\\ /g`
ERRMSG="mcstas: $ERRMSG"
if [[ ${UNAME} == Darwin* ]]; then
    osascript -e "tell app \"System Events\" to display dialog \"${ERRMSG}\""
else
    notify-send "${ERRMSG}"
fi


