Skip to content

Commit

Permalink
Merge pull request michaeldfallen#79 from hallzy/issue69
Browse files Browse the repository at this point in the history
Issue69
  • Loading branch information
michaeldfallen committed Oct 16, 2015
2 parents a72cc51 + 104d96c commit eb0e287
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion radar-base.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
NO_REMOTE_STATUS='--no-remote-status'

dot_git=""
stat_type=""
cwd=""
remote=""
rcfile_path="$HOME"
Expand Down Expand Up @@ -126,6 +127,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
Expand All @@ -150,7 +160,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%Y "$(dot_git)/lastupdatetime" 2>/dev/null || printf '%s' "0")"
fi
}

Expand Down

0 comments on commit eb0e287

Please sign in to comment.