Add support for readlink on macOS
This commit is contained in:
10
rsync_ui.sh
10
rsync_ui.sh
@@ -2,7 +2,15 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
ATTRACT_DIR="$(dirname "$(readlink -f "$0")")"
|
# macOS does not support readlink -f, so we use greadlink instead
|
||||||
|
if [[ `uname` == 'Darwin' ]]; then
|
||||||
|
ash greadlink 2>/dev/null || { echo >&2 "Install greadlink using brew."; exit 1; }
|
||||||
|
readlink='grealink'
|
||||||
|
else
|
||||||
|
readlink='readlink'
|
||||||
|
fi
|
||||||
|
|
||||||
|
ATTRACT_DIR="$(dirname "$($readlink -f "$0")")"
|
||||||
if [ ! -d "$ATTRACT_DIR" ]; then
|
if [ ! -d "$ATTRACT_DIR" ]; then
|
||||||
echo "Unable to find Attract dir '$ATTRACT_DIR'"
|
echo "Unable to find Attract dir '$ATTRACT_DIR'"
|
||||||
exit 1
|
exit 1
|
||||||
|
Reference in New Issue
Block a user