libretro-fetch.sh should now run anywhere

This commit is contained in:
T. Joseph Carter 2015-02-02 09:33:50 -08:00
parent e3f874cb11
commit 0ada2ddbd1

View File

@ -1,7 +1,27 @@
#! /bin/bash #! /bin/bash
# vi: sw=3 ts=3 et # vi: sw=3 ts=3 et
. ./libretro-config.sh # BSDs don't have readlink -f
read_link()
{
TARGET_FILE="${1}"
cd "`dirname "${TARGET_FILE}"`"
TARGET_FILE="`basename "${TARGET_FILE}"`"
while [ -L "${TARGET_FILE}" ]; do
TARGET_FILE="`readlink "${TARGET_FILE}"`"
cd "`dirname "${TARGET_FILE}"`"
TARGET_FILE="`basename "${TARGET_FILE}"`"
done
PHYS_DIR="`pwd -P`"
RESULT="${PHYS_DIR}/${TARGET_FILE}"
echo ${RESULT}
}
SCRIPT="`read_link "$0"`"
BASE_DIR="`dirname "${SCRIPT}"`"
. ${BASE_DIR}/libretro-config.sh
WORKDIR=$(pwd) WORKDIR=$(pwd)