aboutsummaryrefslogtreecommitdiffstats
path: root/priv
diff options
context:
space:
mode:
authorLuis Rascao <[email protected]>2017-02-06 21:32:46 +0000
committerLuis Rascao <[email protected]>2017-03-12 01:15:22 +0000
commit1792f61606aac21f4cfeae2d018f776cc3f8c143 (patch)
tree552fced6e3b0cd387bc13a49ede98baddf0a27b4 /priv
parent87faa210dd6a5589ff86a9cc6992a413022feea7 (diff)
downloadrelx-1792f61606aac21f4cfeae2d018f776cc3f8c143.tar.gz
relx-1792f61606aac21f4cfeae2d018f776cc3f8c143.tar.bz2
relx-1792f61606aac21f4cfeae2d018f776cc3f8c143.zip
Fix OSX readlink
It does not support the -f option.
Diffstat (limited to 'priv')
-rwxr-xr-xpriv/templates/extended_bin11
1 files changed, 10 insertions, 1 deletions
diff --git a/priv/templates/extended_bin b/priv/templates/extended_bin
index 88d2cab..9c96b95 100755
--- a/priv/templates/extended_bin
+++ b/priv/templates/extended_bin
@@ -17,7 +17,16 @@ if [ "$TERM" = "dumb" -o -z "$TERM" ]; then
export TERM=screen
fi
-SCRIPT=$(readlink -f $0 || true)
+# OSX does not support readlink '-f' flag, work
+# around that
+case $OSTYPE in
+ darwin*)
+ SCRIPT=$(readlink $0 || true)
+ ;;
+ *)
+ SCRIPT=$(readlink -f $0 || true)
+ ;;
+esac
[ -z $SCRIPT ] && SCRIPT=$0
SCRIPT_DIR="$(cd `dirname "$SCRIPT"` && pwd -P)"
RELEASE_ROOT_DIR="$(cd "$SCRIPT_DIR/.." && pwd -P)"