aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Sloughter <[email protected]>2017-03-14 09:25:03 -0700
committerGitHub <[email protected]>2017-03-14 09:25:03 -0700
commitaff9fca98f84f8031696a96d85a57eb398355f35 (patch)
treeaeaad8133b7f56a406fe95b741798b27e6feb9b8
parent8f0e68e1897132b50f8578df5f7e635d18ad4070 (diff)
parent1792f61606aac21f4cfeae2d018f776cc3f8c143 (diff)
downloadrelx-aff9fca98f84f8031696a96d85a57eb398355f35.tar.gz
relx-aff9fca98f84f8031696a96d85a57eb398355f35.tar.bz2
relx-aff9fca98f84f8031696a96d85a57eb398355f35.zip
Merge pull request #579 from lrascao/fix/osx_readlink
Fix OSX readlink
-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 c069249..f05fb31 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)"