mirror of
https://github.com/libretro/libretro-super.git
synced 2024-11-23 07:49:44 +00:00
Don't need readlink to find BASE_DIR anymore
This commit is contained in:
parent
662b420d76
commit
5d80de96fc
@ -1,26 +1,18 @@
|
||||
#! /usr/bin/env bash
|
||||
# vim: set ts=3 sw=3 noet ft=sh : bash
|
||||
|
||||
# BSDs don't have readlink -f
|
||||
read_link()
|
||||
{
|
||||
TARGET_FILE="${1}"
|
||||
cd "`dirname "${TARGET_FILE}"`"
|
||||
TARGET_FILE="`basename "${TARGET_FILE}"`"
|
||||
SCRIPT="${0#./}"
|
||||
BASE_DIR="${SCRIPT%/*}"
|
||||
WORKDIR=$PWD
|
||||
|
||||
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}"`"
|
||||
WORKDIR="`pwd`"
|
||||
if [ "$BASE_DIR" = "$SCRIPT" ]; then
|
||||
BASE_DIR="$WORKDIR"
|
||||
else
|
||||
if [[ "$0" != /* ]]; then
|
||||
# Make the path absolute
|
||||
BASE_DIR="$WORKDIR/$BASE_DIR"
|
||||
fi
|
||||
fi
|
||||
|
||||
. ${BASE_DIR}/libretro-config.sh
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user