macOS-compatible realpath
This commit is contained in:
parent
cac6759451
commit
a9dd9b9571
8
miri
8
miri
@ -39,12 +39,8 @@ EOF
|
|||||||
TARGET=$(rustc --version --verbose | grep "^host:" | cut -d ' ' -f 2)
|
TARGET=$(rustc --version --verbose | grep "^host:" | cut -d ' ' -f 2)
|
||||||
SYSROOT=$(rustc --print sysroot)
|
SYSROOT=$(rustc --print sysroot)
|
||||||
LIBDIR=$SYSROOT/lib/rustlib/$TARGET/lib
|
LIBDIR=$SYSROOT/lib/rustlib/$TARGET/lib
|
||||||
if readlink -e . &>/dev/null; then
|
# macOS does not have a useful readlink/realpath so we have to use Python instead...
|
||||||
# This platform supports `readlink -e`.
|
MIRIDIR=$(dirname "$(python -c 'import os, sys; print(os.path.realpath(sys.argv[1]))' "$0")")
|
||||||
MIRIDIR=$(dirname "$(readlink -e "$0")")
|
|
||||||
else
|
|
||||||
MIRIDIR=$(dirname "$0")
|
|
||||||
fi
|
|
||||||
if ! test -d "$LIBDIR"; then
|
if ! test -d "$LIBDIR"; then
|
||||||
echo "Something went wrong determining the library dir."
|
echo "Something went wrong determining the library dir."
|
||||||
echo "I got $LIBDIR but that does not exist."
|
echo "I got $LIBDIR but that does not exist."
|
||||||
|
Loading…
Reference in New Issue
Block a user