diff options
| author | Max Howell | 2011-08-29 10:24:12 +0100 |
|---|---|---|
| committer | Max Howell | 2012-03-09 12:10:50 +0000 |
| commit | cadc0506f9e94f17f522fdd5c14cfb8bbf228d9b (patch) | |
| tree | 4fa9082b03c942bf9627c630511b55a9fcb77a8e | |
| parent | 63d8cb1a6ba5745e9510761399d0799bdc9e5384 (diff) | |
| download | brew-cadc0506f9e94f17f522fdd5c14cfb8bbf228d9b.tar.bz2 | |
cd KNOWN_DIR before executing any functions or tools
It is fucking amazing how much shit breaks if CWD is invalid. Fucking amazing.
Also fuck you dumb user who can't figure out what "No such file or directory - getcwd" means so you force me to waste half an hour fixing it for you.
| -rw-r--r-- | install_homebrew.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/install_homebrew.rb b/install_homebrew.rb index ea2bd9b19..07485e4d3 100644 --- a/install_homebrew.rb +++ b/install_homebrew.rb @@ -66,6 +66,10 @@ def macos_version @macos_version ||= /(10\.\d+)(\.\d+)?/.match(`/usr/bin/sw_vers -productVersion`).captures.first.to_f end +# The block form of Dir.chdir fails later if Dir.CWD doesn't exist which I +# guess is fair enough. Also sudo prints a warning message for no good reason +Dir.chdir "/usr" + ####################################################################### script abort "MacOS too old, see: https://gist.github.com/1144389" if macos_version < 10.5 abort "/usr/local/.git already exists!" unless Dir["/usr/local/.git/*"].empty? |
