#!/bin/bash

set -e

# Find the directory this script lies in, even when the script is called via a
# symlink, as per the installation instructions above. Copied from
# http://stackoverflow.com/a/246128/1839209:
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do
  DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
  SOURCE="$(readlink "$SOURCE")"
  [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE"
done
THIS_SCRIPT_DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"

if [ "$1" = "--help" ]; then
	echo "fman version 1.7.3"
	echo "Usage: fman [left_dir [right_dir]]    open the given directories"
	exit 0
fi

($THIS_SCRIPT_DIR/../../MacOS/fman "$@" > /dev/null 2>&1 &)