summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Allen <michael@michaelallen.io>2015-08-25 17:27:56 +0100
committerMichael Allen <michael@michaelallen.io>2015-08-25 17:27:56 +0100
commit81612cb359baac0b476731aff4eb78e04050f857 (patch)
tree4bfd944369a7cce1353f90b0b72840312b6a0b1d
parentf9f0a484c8fce069d37b7ca5f7b7e17b3742677c (diff)
downloadgit-sonar-81612cb359baac0b476731aff4eb78e04050f857.tar.gz
git-sonar-81612cb359baac0b476731aff4eb78e04050f857.zip
Follow symlinks when loading libs0.1
-rwxr-xr-xfetch.sh9
-rwxr-xr-xgit-radar12
2 files changed, 19 insertions, 2 deletions
diff --git a/fetch.sh b/fetch.sh
index c06bbad..37601e3 100755
--- a/fetch.sh
+++ b/fetch.sh
@@ -1,6 +1,13 @@
#! /usr/bin/env bash
-dot="$(cd "$(dirname "$0")"; pwd)"
+if [[ "$OSTYPE" == *darwin* ]]; then
+ READLINK_CMD='greadlink'
+else
+ READLINK_CMD='readlink'
+fi
+
+dot="$(cd "$(dirname "$([ -L "$0" ] && $READLINK_CMD -f "$0" || echo "$0")")"; pwd)"
+
source $dot/radar-base.sh
fetch;
diff --git a/git-radar b/git-radar
index ebda515..f194557 100755
--- a/git-radar
+++ b/git-radar
@@ -1,6 +1,16 @@
#! /usr/bin/env bash
+#
+# git-radar
+#
+# A heads up display for git
-dot="$(cd "$(dirname "$0")"; pwd)"
+if [[ "$OSTYPE" == *darwin* ]]; then
+ READLINK_CMD='greadlink'
+else
+ READLINK_CMD='readlink'
+fi
+
+dot="$(cd "$(dirname "$([ -L "$0" ] && $READLINK_CMD -f "$0" || echo "$0")")"; pwd)"
if [[ -z $@ ]]; then
_git="\033[1;30mgit:(\033[0m"