summaryrefslogtreecommitdiffstats
path: root/bashrc
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2018-11-16 03:20:56 -0500
committerJesse Luehrs <doy@tozt.net>2018-11-16 03:20:56 -0500
commit790064c91f1291b55ac3a6627c41c8181e4b6b42 (patch)
tree8fc98a0e9326613def8174eda79189ff02428d73 /bashrc
parent654d626159e1fab6bb6cd85c4ad593ea260c3195 (diff)
downloadconf-790064c91f1291b55ac3a6627c41c8181e4b6b42.tar.gz
conf-790064c91f1291b55ac3a6627c41c8181e4b6b42.zip
shellcheck
Diffstat (limited to 'bashrc')
-rw-r--r--bashrc32
1 files changed, 19 insertions, 13 deletions
diff --git a/bashrc b/bashrc
index 52966e3..c6015cf 100644
--- a/bashrc
+++ b/bashrc
@@ -1,36 +1,41 @@
# language environments {{{
-test -f $HOME/perl5/perlbrew/etc/bashrc && source $HOME/perl5/perlbrew/etc/bashrc
-test -f $HOME/python/bin/activate && source $HOME/python/bin/activate
+# shellcheck disable=1090
+test -f "$HOME"/perl5/perlbrew/etc/bashrc && source "$HOME"/perl5/perlbrew/etc/bashrc
+test -f "$HOME"/python/bin/activate && source "$HOME"/python/bin/activate
type rbenv > /dev/null 2>&1 && eval "$(rbenv init -)"
-test -d $HOME/.cargo/bin && export PATH="$HOME/.cargo/bin:$PATH"
+test -d "$HOME"/.cargo/bin && export PATH="$HOME/.cargo/bin:$PATH"
# }}}
# environment {{{
[ -d /usr/share/git/diff-highlight ] && export PATH="/usr/share/git/diff-highlight:${PATH}"
[ -d /usr/local/share/git-core/contrib/diff-highlight ] && export PATH="/usr/local/share/git-core/contrib/diff-highlight:${PATH}"
-export PATH="${HOME}/.bin/local:${HOME}/.bin/$(hostname):${HOME}/.bin:/usr/lib/ccache/bin:$PATH"
-[ -f "$HOME/.config/sh/env" ] && source $HOME/.config/sh/env
+PATH="${HOME}/.bin/local:${HOME}/.bin/$(hostname):${HOME}/.bin:/usr/lib/ccache/bin:$PATH"
+export PATH
+[ -f "$HOME/.config/sh/env" ] && source "$HOME"/.config/sh/env
# }}}
# Test for an interactive shell. {{{
# There is no need to set anything past this point for scp and rcp, and it's
# important to refrain from outputting anything in those cases.
if [[ $- != *i* ]] ; then
- # Shell is non-interactive. Be done now!
- return
+ # Shell is non-interactive. Be done now!
+ return
fi
[ -z "$PS1" ] && return # }}}
# Change the window title of X terminals {{{
case ${TERM} in
- xterm*|rxvt*|Eterm|aterm|kterm|gnome|screen*)
- PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/$HOME/~}\007"'
- ;;
+ xterm*|rxvt*|Eterm|aterm|kterm|gnome|screen*)
+ PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/$HOME/~}\007"'
+ ;;
esac # }}}
# aliases {{{
-[ -f "$HOME/.config/sh/aliases" ] && source $HOME/.config/sh/aliases
-[ -f "$HOME/.config/sh/functions" ] && source $HOME/.config/sh/functions
+[ -f "$HOME/.config/sh/aliases" ] && source "$HOME"/.config/sh/aliases
+[ -f "$HOME/.config/sh/functions" ] && source "$HOME"/.config/sh/functions
# }}}
# completion {{{
+#shellcheck disable=SC1091
[ -f /etc/bash_completion ] && source /etc/bash_completion
+#shellcheck disable=SC1091
[ -f /etc/profile.d/bash-completion ] && source /etc/profile.d/bash-completion
+#shellcheck disable=SC1091
[ -f /usr/share/bash-completion/bash_completion ] && source /usr/share/bash-completion/bash_completion
# }}}
# bash configuration {{{
@@ -57,7 +62,8 @@ source ~/.config/sh/fzf/shell/key-bindings.bash
# }}}
# prompt {{{
if type fancy-prompt > /dev/null 2>&1; then
- export PROMPT_COMMAND="__err=\$?;$PROMPT_COMMAND;PS1=\"\$(fancy-prompt --prompt-escape bash "\$__err")\""
+ __err=0
+ export PROMPT_COMMAND="__err=\$?;$PROMPT_COMMAND;PS1=\"\$(fancy-prompt --prompt-escape bash \$__err)\""
fi
# }}}
# }}}