diff options
| -rwxr-xr-x | git-sonar | 28 |
1 files changed, 7 insertions, 21 deletions
@@ -7,27 +7,8 @@ GIT_SONAR_VERSION="v0.8.1" dot_git="" -rcfile_path="$HOME" - -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_colors() { - if [ -f "$rcfile_path/.gitradarrc" ]; then - source "$rcfile_path/.gitradarrc" - fi - PRINT_F_OPTION="" COLOR_REMOTE_AHEAD="\x01${GIT_RADAR_COLOR_REMOTE_AHEAD:-"\\033[1;32m"}\x02" @@ -109,8 +90,7 @@ time_to_update() { } fetch() { - # Gives $FETCH_TIME a value - get_fetch_time + FETCH_TIME="${GIT_RADAR_FETCH_TIME:-"$((5 * 60))"}" if time_to_update "$FETCH_TIME"; then record_timestamp @@ -576,6 +556,12 @@ fi # Guard all active operations by this is_repo check if is_repo; then + # Merge configuration from accepted RC files + [ -f "$HOME/.gitradarrc" ] && . "$HOME/.gitradarrc" + [ -f "$HOME/.gitradarrc.bash" ] && . "$HOME/.gitradarrc.bash" + [ -f "$HOME/.gitradarrc.zsh" ] && . "$HOME/.gitradarrc.zsh" + [ -f "$HOME/.gitsonarrc" ] && . "$HOME/.gitsonarrc" + [ -n "$do_fetch" ] && fetch >/dev/null 2>&1 prepare_colors render_prompt |
