aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2013-05-26 13:57:24 +1200
committerTom Ryder <tom@sanctum.geek.nz>2013-05-26 13:57:24 +1200
commitd87c87c2510313f23bc9a6a22b19b0e998ee8d5b (patch)
tree23ebba4126c95205e8b77e7b6d56a592dc209f35
parentUpdate install script (diff)
downloaddotfiles-d87c87c2510313f23bc9a6a22b19b0e998ee8d5b.tar.gz
dotfiles-d87c87c2510313f23bc9a6a22b19b0e998ee8d5b.zip
More intelligent PATH calculation
-rw-r--r--bash/bashrc26
1 files changed, 13 insertions, 13 deletions
diff --git a/bash/bashrc b/bash/bashrc
index 06bca1ea..742f58ee 100644
--- a/bash/bashrc
+++ b/bash/bashrc
@@ -66,22 +66,22 @@ hash stty &>/dev/null && stty -ixon
# Use completion, if available.
[[ -e /etc/bash_completion ]] && source /etc/bash_completion
-# Add various paths if they exist and aren't already in here.
-pathdirs="${HOME}/bin
- /usr/local/apache/bin
- /usr/local/mysql/bin
- /usr/local/nagios/bin
- /usr/local/pgsql/bin"
+# Add various binary paths if they exist
+pathdirs="${HOME}/.local/bin
+ ${HOME}/bin
+ /usr/local/apache/bin
+ /usr/local/mysql/bin
+ /usr/local/nagios/bin
+ /usr/local/pgsql/bin"
for pathdir in $pathdirs; do
- if [[ -d "$pathdir" ]] && [[ ":${PATH}:" != *":${pathdir}:"* ]]; then
- if [[ -n "$PATH" ]]; then
- PATH="${pathdir}:${PATH}"
- else
- PATH=$pathdir
- fi
- fi
+ [[ -d "$pathdir" ]] \
+ && PATH="${pathdir}:${PATH}"
done
+# Add various manual paths if they exist
+[[ -d "${HOME}/.local/share/man" ]] \
+ && MANPATH="${HOME}/.local/share/man:${MANPATH}"
+
# Figure out how many colors we have now.
hash tput && colors=$(tput colors)