commit fc0188bf5ad8284bd095e416ed0624d4777437c3
parent 251f39dbcf62aec85ba5082661c2bbea9fa09366
Author: Chris Bracken <chris@bracken.jp>
Date: Wed, 28 Nov 2012 10:19:32 -0800
Moved path maninpulation to .paths
Diffstat:
4 files changed, 32 insertions(+), 14 deletions(-)
diff --git a/.bashrc b/.bashrc
@@ -69,6 +69,10 @@ xterm*|rxvt*)
;;
esac
+# path additions
+if [ -f ~/.paths ]; then
+ . ~/.paths
+fi
# aliases
if [ -f ~/.aliases ]; then
. ~/.aliases
diff --git a/.paths b/.paths
@@ -0,0 +1,22 @@
+# add to path if not already there
+path_remove() {
+ PATH=`echo $PATH | sed "s:$1::;s/::/:/;s/:$//"`
+}
+
+path_prepend() {
+ path_remove "$1"
+ export PATH="$1:$PATH"
+}
+
+path_append() {
+ path_remove "$1"
+ export PATH="$PATH:$1"
+}
+
+# set PATH so it includes user's private bin if it exists
+path_prepend "$HOME/bin"
+
+# update PATH variable for use with MacPorts
+path_prepend "/opt/local/sbin"
+path_prepend "/opt/local/bin"
+path_prepend "/opt/local/libexec/gnubin"
diff --git a/.profile b/.profile
@@ -9,7 +9,7 @@
umask 022
export EDITOR=/usr/bin/vim
-export GNUPGHOME="$HOME/.gnupg"
+export GNUPGHOME=/Volumes/Personal/.gnupg
if [ -n "$BASH_VERSION" ]; then
# bash doesn't read .bashrc in login shells, do it manually
@@ -18,19 +18,6 @@ if [ -n "$BASH_VERSION" ]; then
fi
fi
-# add to path if not already there
-path_add() {
- [ -d "$1" ] && [[ ":$PATH:" != *":$1:"* ]] && PATH="$1:$PATH"
-}
-
-# set PATH so it includes user's private bin if it exists
-path_add "$HOME/bin"
-
-# update PATH variable for use with MacPorts
-path_add "/opt/local/sbin"
-path_add "/opt/local/bin"
-path_add "/opt/local/libexec/gnubin"
-
# start gpg-agent
if [ -f "$HOME/.gpg-agent-info" ] && kill -0 `cut -d: -f 2 "$HOME/.gpg-agent-info"` 2>/dev/null; then
. "$HOME/.gpg-agent-info"
diff --git a/.zshrc b/.zshrc
@@ -50,6 +50,11 @@ else
fi
unset color_prompt force_color_prompt
+# path additions
+if [ -f ~/.paths ]; then
+ . ~/.paths
+fi
+
# aliases
if [ -f ~/.aliases ]; then
. ~/.aliases