summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Hall <Hallzy.18@gmail.com>2015-10-15 12:34:08 -0700
committerSteven Hall <Hallzy.18@gmail.com>2015-10-15 12:34:08 -0700
commitf29d9440b856c884b3a3046ac1c696433c06f5ae (patch)
tree10f05f3e6edf76ac7b03635a3120f288610bd433
parent42135ad00014387b6937242563b920a7cf640866 (diff)
downloadgit-sonar-f29d9440b856c884b3a3046ac1c696433c06f5ae.tar.gz
git-sonar-f29d9440b856c884b3a3046ac1c696433c06f5ae.zip
Provides a fix for Isssue #69.
-rwxr-xr-xradar-base.sh12
1 files changed, 11 insertions, 1 deletions
diff --git a/radar-base.sh b/radar-base.sh
index 258e5b1..429fa8f 100755
--- a/radar-base.sh
+++ b/radar-base.sh
@@ -1,6 +1,7 @@
NO_REMOTE_STATUS='--no-remote-status'
dot_git=""
+stat_type=""
cwd=""
remote=""
rcfile_path="$HOME"
@@ -119,6 +120,15 @@ dot_git() {
fi
}
+stat_type() {
+ if [[ "$OSTYPE" == "darwin"* ]]; then
+ stat_type="gstat"
+ else
+ stat_type="stat"
+ fi
+ printf '%s' $stat_type
+}
+
is_repo() {
if [[ -n "$(dot_git)" ]]; then
return 0
@@ -143,7 +153,7 @@ record_timestamp() {
timestamp() {
if is_repo; then
- printf '%s' "$(stat -f%m "$(dot_git)/lastupdatetime" 2>/dev/null || printf '%s' "0")"
+ printf '%s' "$("$(stat_type)" -c%Z "$(dot_git)/lastupdatetime" 2>/dev/null || printf '%s' "0")"
fi
}