From 099295312160e3392ce924bbb930ce9396e37a38 Mon Sep 17 00:00:00 2001 From: Raoul Millais Date: Mon, 24 Oct 2016 11:42:38 +0100 Subject: [PATCH] Setup fixes for OSX - Use a more robust way of determining the location of the setup script - Style fix: make INCLUDE path constant --- bin/setup | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/bin/setup b/bin/setup index e2faf258..e3d770ff 100755 --- a/bin/setup +++ b/bin/setup @@ -3,11 +3,15 @@ # # Prelude # -INCLUDE=$(dirname $(readlink -f $0)) -. $INCLUDE/setup_tools - set -euo pipefail IFS=$'\n\t' +# Beware of CDPATH gotchas causing cd not to work correctly when a user +# has set this in their environment +# https://bosker.wordpress.com/2012/02/12/bash-scripters-beware-of-the-cdpath/ +unset CDPATH + +readonly INCLUDE="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +. "${INCLUDE}"/setup_tools # # Main