From 0a6ac8fca2b1f37da6dd5c413190ada4cc1b3e53 Mon Sep 17 00:00:00 2001 From: Fernando Schauenburg Date: Mon, 18 Feb 2019 22:51:13 +0100 Subject: [PATCH] Avoid non-zero exit code at end of .bashrc The previous syntax caused the last command to evaluate to a non-zero exit code when .bashrc.local does not exist. This was annoying because we show a non-zero exit code in the prompt, so the first prompt on every bash session would show this exit code. --- bash/.bashrc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bash/.bashrc b/bash/.bashrc index 3a4de12..838f712 100644 --- a/bash/.bashrc +++ b/bash/.bashrc @@ -290,5 +290,9 @@ bashrc_customize_ls [ -f ~/.config/shell/git-prompt.sh ] && . ~/.config/shell/git-prompt.sh [ -f ~/.config/shell/git-completion.bash ] && . ~/.config/shell/git-completion.bash -[ -f ~/.bashrc.local ] && . ~/.bashrc.local + +# Source a local bashrc if available +if [ -f "$HOME/.bashrc.local" ]; then + source "$HOME/.bashrc.local" +fi