simplify interactive shell check in bash_profile; add check for bash_profile existence before sourcing
This commit is contained in:
@@ -2,25 +2,22 @@
|
|||||||
# Adrian Abeyta <adrian@adrianabeyta.com>
|
# Adrian Abeyta <adrian@adrianabeyta.com>
|
||||||
|
|
||||||
# don't do anything if not running interactively
|
# don't do anything if not running interactively
|
||||||
case $- in
|
[[ $- != *i* ]] && return
|
||||||
*i*) ;;
|
|
||||||
*) return;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# include user home bins if they exist
|
# include user home bins if they exist
|
||||||
if [ -d "$HOME/bin" ] ; then
|
if [ -d "$HOME/bin" ] ; then
|
||||||
PATH="$HOME/bin:$PATH"
|
PATH="$HOME/bin:$PATH"
|
||||||
fi;
|
fi
|
||||||
if [ -d "$HOME/.local/bin" ] ; then
|
if [ -d "$HOME/.local/bin" ] ; then
|
||||||
PATH="$HOME/.local/bin:$PATH"
|
PATH="$HOME/.local/bin:$PATH"
|
||||||
fi;
|
fi
|
||||||
|
|
||||||
# load the dotfiles
|
# load the dotfiles
|
||||||
for file in ~/.{env,path,functions,aliases,prompt}; do
|
for file in ~/.{env,path,functions,aliases,prompt}; do
|
||||||
[ -r "$file" ] && [ -f "$file" ] && \
|
[ -r "$file" ] && [ -f "$file" ] && \
|
||||||
source "$file";
|
source "$file";
|
||||||
done;
|
done;
|
||||||
unset file;
|
unset file
|
||||||
|
|
||||||
# fun scripts
|
# fun scripts
|
||||||
if is_true "${HAVE_FUN:-}"; then
|
if is_true "${HAVE_FUN:-}"; then
|
||||||
@@ -35,4 +32,4 @@ shopt -s checkwinsize # update col/line values on each command
|
|||||||
# enable tab completion for 'g' by marking as alias for 'git'
|
# enable tab completion for 'g' by marking as alias for 'git'
|
||||||
if type _git &> /dev/null; then
|
if type _git &> /dev/null; then
|
||||||
complete -o default -o nospace -F _git g;
|
complete -o default -o nospace -F _git g;
|
||||||
fi;
|
fi
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
[ -n "$PS1" ] && source ~/.bash_profile;
|
[ -n "$PS1" ] && [[ -f ~/.bash_profile ]] && source ~/.bash_profile;
|
||||||
|
|||||||
Reference in New Issue
Block a user