#!/bin/sh
if [ 0`readlink $0` = "0" ]; then
  REALPATH=$0
else
  REALPATH=`readlink $0`
fi
APPPATH="${REALPATH%/*}"
if [ "$APPPATH" = "shoes" ]; then
  APPPATH="."
fi
if [ "$APPPATH" = "." ]; then
  APPPATH=`pwd`
fi

# makeself changes the directory to /tmp/selfgzNNNNN.  if we're in
# an extracted archive, change back to the directory where we launched.
if [ `pwd | awk '{ sub(/[0-9]+/, ""); print }'` = "/tmp/selfgz" ]; then
  # fix the symlink, this is actually a bug in the minitar lib
  rm -f libruby.so.1.8
  ln -s libruby.so libruby.so.1.8
  cd "$OLDPWD"
fi
LD_LIBRARY_PATH="$APPPATH/../lib/shoes" $APPPATH/../lib/shoes/shoes-bin $@
