From 0449951e99851eb1214ed6cd783d0699126b63c5 Mon Sep 17 00:00:00 2001 From: Nathan Broadbent Date: Tue, 18 Oct 2011 00:23:27 +0800 Subject: [PATCH] Only load if ~/.git.scmbrc exists --- scm_breeze.sh | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/scm_breeze.sh b/scm_breeze.sh index 22d3f82..a952fd3 100644 --- a/scm_breeze.sh +++ b/scm_breeze.sh @@ -2,22 +2,25 @@ # scm_breeze.sh must be sourced, and not executed in a sub-shell. # e.g "source ~/.scm_breeze/scm_breeze.sh" # ------------------------------------------------------------ - export scmbreezeDir="$(dirname ${BASH_SOURCE:-$0})" -# Load config -. "$HOME/.git.scmbrc" -. "$scmbreezeDir/lib/_shared.sh" -. "$scmbreezeDir/lib/git/aliases_and_bindings.sh" -. "$scmbreezeDir/lib/git/status_shortcuts.sh" -. "$scmbreezeDir/lib/git/repo_management.sh" -. "$scmbreezeDir/lib/git/tools.sh" +# Git +# ------------------------------------------------------------ +if [[ -s "$HOME/.git.scmbrc" ]]; then + # Load config + . "$HOME/.git.scmbrc" + . "$scmbreezeDir/lib/_shared.sh" + . "$scmbreezeDir/lib/git/aliases_and_bindings.sh" + . "$scmbreezeDir/lib/git/status_shortcuts.sh" + . "$scmbreezeDir/lib/git/repo_management.sh" + . "$scmbreezeDir/lib/git/tools.sh" -if ! type ruby > /dev/null 2>&1; then - # If Ruby is not installed, fall back to the - # slower bash/zsh implementation of 'git_status_shortcuts' - . "$scmbreezeDir/lib/git/fallback/status_shortcuts_shell.sh" + if ! type ruby > /dev/null 2>&1; then + # If Ruby is not installed, fall back to the + # slower bash/zsh implementation of 'git_status_shortcuts' + . "$scmbreezeDir/lib/git/fallback/status_shortcuts_shell.sh" + fi fi