#!/bin/sh
# This starts gowrite
#
# 28-03-2012: Automatically add libraries from lib dir.
#
# 18-04-2009: Added quotes

# If you want to start gowrite with specific java version, set $GOWRITE_JAVA to point to java executable
jcmd=java
if [ "$GOWRITE_JAVA" != "" ]; then
  jcmd="$GOWRITE_JAVA"
fi

base="${0%/*}"

cp="$base/GOWrite.jar"
cp="$cp:$base/GOWriteHelp.jar"
cp="$cp:$base/lib/jh.jar"
cp="$cp:$base/lib/swing-layout-1.0.3.jar"
cp="$cp:$base/lib/h2.jar"
cp="$cp:$base/lib/sgf4help.jar"
for libs in $(find "$base/lib/" -name "GOWrite*.jar")
  do
  cp="$cp:$libs"
  done
"$jcmd" -Dgowrite.root="$base" -Xmx400m -cp "$cp" GOWrite2 "$@"

