Permalink
Browse files

fix paths for homebrew even if os x (patched) is re-setting PATH in /…

…etc/zprofile
  • Loading branch information...
1 parent a5a184a commit 4849fda99ba77543c15cc940a966be63333ea0a9 @rsanders committed Sep 13, 2012
Showing with 30 additions and 12 deletions.
  1. +20 −0 zsh/plugins/homebrew/movepaths.zsh
  2. +9 −0 zsh/plugins/homebrew/zprofile.zsh
  3. +1 −12 zsh/plugins/homebrew/zshenv.zsh
@@ -0,0 +1,20 @@
+#!/bin/zsh
+#
+# The homebrew packaging system. See
+# git://github.com/mxcl/homebrew.git
+#
+
+emulate -L zsh
+
+typeset -g BREWPREFIX
+local root=""
+
+# find homebrew and move it to the beginning of the path
+for root in /usr/local /usr/local/homebrew /usr/local/brew /opt/brew /opt/homebrew ${HOMEBREW_PATH:-/usr/local}; do
+ if [[ -d $root/bin && -x $root/bin/brew && -d $root/Library/Formula ]]; then
+ BREWPREFIX=$root
+ set~prepend path ${root}/bin ${root}/sbin
+ break
+ fi
+done
+
@@ -0,0 +1,9 @@
+#!/bin/zsh
+#
+# The homebrew packaging system. See
+# git://github.com/mxcl/homebrew.git
+#
+
+emulate -L zsh
+
+source ${0:h}/movepaths.zsh
@@ -7,16 +7,5 @@
emulate -L zsh
unsetopt warn_create_global
-local root=""
-
-typeset -g BREWPREFIX
-
-# find homebrew and move it to the beginning of the path
-for root in /usr/local /usr/local/homebrew /usr/local/brew /opt/brew /opt/homebrew ${HOMEBREW_PATH:-/usr/local}; do
- if [[ -d $root/bin && -x $root/bin/brew && -d $root/Library/Formula ]]; then
- BREWPREFIX=$root
- set~prepend path ${root}/bin ${root}/sbin
- break
- fi
-done
+source ${0:h}/movepaths.zsh

0 comments on commit 4849fda

Please sign in to comment.