#!/bin/sh

BASEDIR="/usr/local/share/hfsexplorer/lib"
if [ $? -ne 0 ]; then
    echo "WARNING: No dirname utility found!"
    echo "         Script will only work if invoked from its parent directory."
    BASEDIR="/usr/local/share/hfsexplorer/lib"
fi

LIB="${BASEDIR}/../lib"

UNAME=`uname`
case "${UNAME}" in
Darwin*)
    DOCK_NAME="-Xdock:name=HFSExplorer"
    DOCK_ICON="-Xdock:icon=${BASEDIR}/../res/icon.png"
    ;;
mingw*|MINGW*|MSYS*)
    # Our library dir must be in the PATH in Windows so that llio dlls can be
    # located.
    export PATH="${PATH}:${LIB}"
    ;;
esac

java ${DOCK_NAME:+"${DOCK_NAME}"} ${DOCK_ICON:+"${DOCK_ICON}"} -cp "$LIB/hfsx.jar" org.catacombae.hfsexplorer.FileSystemBrowserWindow "$@"
