#!/bin/sh
# start the Curry Integrated Development EnviRonment:

# first determine directory of this script:
PATHNAME=`(cd \`dirname $0\` ; pwd)`

# make sure that there is a saved state:
(cd $PATHNAME ; make Main.state)

if test ! -f $PATHNAME/Main.state ; then
   exit 1
fi

# start the IOServer process and wait a little bit:
echo "startIOServer" | $PATHNAME/Main.state &
IOS_PID=$!
#echo $IOS_PID
sleep 2

# start the main program:
echo "start" | $PATHNAME/Main.state

# kill the IOServer process:
kill -9 $IOS_PID
