1b2a92d5dab0

Moar.
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Sun, 23 Sep 2012 18:32:44 -0400
parents 3914c613a920
children 3612a95576aa
branches/tags (none)
files fish/config.fish moom/com.manytricks.Moom.plist

Changes

--- a/fish/config.fish	Sun Sep 23 18:16:09 2012 -0400
+++ b/fish/config.fish	Sun Sep 23 18:32:44 2012 -0400
@@ -90,20 +90,23 @@
 # }}}
 # Environment variables {{{
 
-set PATH "/usr/local/bin"          $PATH
-set PATH "/usr/local/share/python" $PATH
-set PATH "/usr/local/sbin"         $PATH
-set PATH "$HOME/bin"               $PATH
-set PATH "$HOME/lib/dotfiles/bin"  $PATH
-set PATH "/opt/local/bin"          $PATH
-set PATH "/opt/subversion/bin"     $PATH
-set PATH "$HOME/lib/hg/hg"         $PATH
-
-set PATH "$HOME/Library/Haskell/bin" $PATH
-
-set PATH "/usr/local/Cellar/ruby/1.9.3-p194/bin" $PATH
-
-set PATH "/usr/local/Cellar/ruby/1.9.3-p125/bin" $PATH
+function prepend_to_path -d "Prepend the given dir to PATH if it exists and is not already in it"
+    if test -d $argv[1]
+        if not contains $argv[1] $PATH
+            set -g PATH "$argv[1]" $PATH
+        end
+    end
+end
+prepend_to_path "/usr/local/bin"
+prepend_to_path "/usr/local/share/python"
+prepend_to_path "/usr/local/sbin"
+prepend_to_path "$HOME/bin"
+prepend_to_path "$HOME/lib/dotfiles/bin"
+prepend_to_path "/opt/local/bin"
+prepend_to_path "/opt/subversion/bin"
+prepend_to_path "$HOME/lib/hg/hg"
+prepend_to_path "$HOME/Library/Haskell/bin"
+prepend_to_path "/usr/local/Cellar/ruby/1.9.3-p194/bin"
 
 set BROWSER open
 
@@ -122,11 +125,11 @@
 set -g -x PYTHONSTARTUP "$HOME/.pythonrc.py"
 set -g -x WORKON_HOME "$HOME/lib/virtualenvs"
 
-set PATH $PATH "/usr/local/share/python"
-set PATH $PATH "/usr/local/Cellar/PyPi/3.6/bin"
-set PATH $PATH "/usr/local/Cellar/python/2.7.1/bin"
-set PATH $PATH "/usr/local/Cellar/python/2.7/bin"
-set PATH $PATH "/usr/local/Cellar/python/2.6.5/bin"
+prepend_to_path "/usr/local/share/python"
+prepend_to_path "/usr/local/Cellar/PyPi/3.6/bin"
+prepend_to_path "/usr/local/Cellar/python/2.7.1/bin"
+prepend_to_path "/usr/local/Cellar/python/2.7/bin"
+prepend_to_path "/usr/local/Cellar/python/2.6.5/bin"
 
 set -g -x PYTHONPATH ""
 set PYTHONPATH "$PYTHONPATH:/usr/local/lib/python2.7.1/site-packages"
Binary file moom/com.manytricks.Moom.plist has changed