#!/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/share/mcstas/resources
export PATH=$PREFIX/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


