From 1f7c440fd90761e8bf36aa2b538a600016ab931c Mon Sep 17 00:00:00 2001 From: Taylor Bockman Date: Fri, 20 Dec 2019 14:32:04 -0800 Subject: [PATCH] Update in .bashrc to be OSX compliant --- dotfiles/bash/bashrc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/dotfiles/bash/bashrc b/dotfiles/bash/bashrc index 917f54a..f801d9f 100644 --- a/dotfiles/bash/bashrc +++ b/dotfiles/bash/bashrc @@ -6,7 +6,13 @@ # This monstrosity returns the directory of the .bashrc from it's symlinked source so we can # call script files correctly. -symlink_dir=$( cd "$( dirname "`readlink -f ${BASH_SOURCE[0]}`" )" && pwd ) + +if [[ "$OSTYPE" == "linux-gnu" ]]; then + symlink_dir=$(cd "$( dirname "`readlink -f ${BASH_SOURCE[0]}`" )" && pwd) +else + # OS X is not a fan of `readlink -f` + symlink_dir=$(cd "$( dirname "`readlink ${BASH_SOURCE[0]}`" )" && pwd) +fi # Useful global functions alias cgen=$symlink_dir/scripts/cgen.sh