diff options
author | Steven Hall <Hallzy.18@gmail.com> | 2015-10-18 16:27:32 -0700 |
---|---|---|
committer | Steven Hall <Hallzy.18@gmail.com> | 2015-10-18 16:27:32 -0700 |
commit | 8bef8d80648accd2806ad44e8db6e3aacd92d2e7 (patch) | |
tree | 7074e62288ed1baf19184b82c55e2026293fce59 /radar-base.sh | |
parent | 3bdb43d9dad5766c23a34e438ad3fbd05823b6bd (diff) | |
download | git-sonar-8bef8d80648accd2806ad44e8db6e3aacd92d2e7.tar.gz git-sonar-8bef8d80648accd2806ad44e8db6e3aacd92d2e7.zip |
Custom Fetch time now uses a variable
Set the variable GIT_RADAR_FETCH_TIME in a bashrc, zshrc or gitradarrc file to
customize the fetch time.
Diffstat (limited to '')
-rwxr-xr-x | radar-base.sh | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/radar-base.sh b/radar-base.sh index d639fa0..f9d834a 100755 --- a/radar-base.sh +++ b/radar-base.sh @@ -13,6 +13,20 @@ timethis() { echo "$1 - $dur" >> $HOME/duration.dat } +get_fetch_time() { + if [ -f "$rcfile_path/.gitradarrc.bash" ]; then + source "$rcfile_path/.gitradarrc.bash" + elif [ -f "$rcfile_path/.gitradarrc.zsh" ]; then + source "$rcfile_path/.gitradarrc.zsh" + elif [ -f "$rcfile_path/.gitradarrc" ]; then + source "$rcfile_path/.gitradarrc" + fi + + FETCH_TIME="${GIT_RADAR_FETCH_TIME:-"$((5 * 60))"}" + echo $FETCH_TIME + +} + prepare_bash_colors() { if [ -f "$rcfile_path/.gitradarrc.bash" ]; then source "$rcfile_path/.gitradarrc.bash" @@ -167,7 +181,8 @@ time_to_update() { } fetch() { - local timeToUpdate=${1:-"$((5 * 60))"} + get_fetch_time + local timeToUpdate=${1:-$FETCH_TIME} if time_to_update $timeToUpdate; then record_timestamp |