1
0
mirror of https://github.com/mitb-archive/filebot synced 2024-08-13 17:03:45 -04:00

* fix relative symlink resolution issues (for homebrew)

This commit is contained in:
Reinhard Pointner 2014-06-19 07:07:44 +00:00
parent 397dd744df
commit cbeb74f1f3
2 changed files with 19 additions and 10 deletions

View File

@ -1,8 +1,23 @@
#!/bin/bash
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done
SOURCE="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
PRG="${BASH_SOURCE[0]}"
APP_ROOT="$SOURCE/../.."
# resolve relative symlinks
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG="`dirname "$PRG"`/$link"
fi
done
# make it fully qualified
WORKING_DIR=`pwd`
PRG_DIR=`dirname "$PRG"`
APP_ROOT=`cd "$PRG_DIR/../.." && pwd`
# restore original working dir
cd "$WORKING_DIR"
java -Djava.awt.headless=true -Dunixfs=false -DuseExtendedFileAttributes=true -DuseCreationDate=false -Djava.net.useSystemProxies=true -Dsun.net.client.defaultConnectTimeout=10000 -Dsun.net.client.defaultReadTimeout=60000 -Djna.nosys=true -Dapplication.deployment=app "-Djna.library.path=$APP_ROOT/Contents/MacOS" "-Djava.library.path=$APP_ROOT/Contents/MacOS" "-Dnet.filebot.AcoustID.fpcalc=$APP_ROOT/Contents/MacOS/fpcalc" -jar "$APP_ROOT"/Contents/Java/* "$@"

View File

@ -1,6 +0,0 @@
#!/bin/bash
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done
SOURCE="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
sudo ln -s -f "$SOURCE/filebot.sh" "/usr/bin/filebot"