Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

Commit

Permalink
Move the Dir.getwd after help
Browse files Browse the repository at this point in the history
Because we should always be able to help. And I've checked, it works fine.
  • Loading branch information
mxcl committed Mar 13, 2011
1 parent 73c7a3a commit 53f83cc
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions bin/brew
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
#!/usr/bin/ruby
# -*- coding: utf-8 -*-

# Many Pathname operations use getwd when they shouldn't, and then throw
# odd exceptions. Reduce our support burden by showing a user-friendly error.
Dir.getwd rescue abort "The current working directory doesn't exist, cannot proceed."

HOMEBREW_BREW_FILE = ENV['HOMEBREW_BREW_FILE'] = File.expand_path(__FILE__)

require 'pathname'
Expand Down Expand Up @@ -41,6 +37,11 @@ if MACOS_VERSION < 10.5
EOABORT
end

# Many Pathname operations use getwd when they shouldn't, and then throw
# odd exceptions. Reduce our support burden by showing a user-friendly error.
Dir.getwd rescue abort "The current working directory doesn't exist, cannot proceed."


def require? path
require path.to_s.chomp
rescue LoadError => e
Expand Down

0 comments on commit 53f83cc

Please sign in to comment.