Skip to content

Commit

Permalink
Some bulletproofing for bash completion script.
Browse files Browse the repository at this point in the history
Since Homebrew's Library doesn't have to be linked under prefix,
we need to do some extra work in the bash completion script to
support this configuration.

Added a "--repository" option to brew, and updated the completion
script to use paths relative to this location.
  • Loading branch information
adamv authored and mxcl committed Jan 16, 2010
1 parent 5bcc1df commit 75b8a06
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 1 addition & 2 deletions Library/Contributions/brew_bash_completion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ _brew_to_completion()
return 0
# Subcommands
else
brew_base=`which brew`
brew_base=`dirname ${brew_base}`/..
brew_base=`brew --repository`

case ${prev} in
# Commands that take a formula...
Expand Down
2 changes: 2 additions & 0 deletions bin/brew
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ begin
case arg = ARGV.shift
when '--prefix'
puts HOMEBREW_PREFIX
when '--repository'
puts HOMEBREW_REPOSITORY
when '--config'
dump_config

Expand Down

0 comments on commit 75b8a06

Please sign in to comment.