Don't look broken if CWD doesn't exist
Ruby throws if CWD doesn't exist, even when you aren't doing anything related to the CWD. Sucks. So at least show the user a friendly error message rather than looking broken.
This commit is contained in:
parent
1fcd449c6e
commit
5599316971
4
bin/brew
4
bin/brew
@ -1,6 +1,10 @@
|
||||
#!/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."
|
||||
|
||||
def homebrew_rubylib_path
|
||||
lib_path = "/../../Library/Homebrew"
|
||||
# we resolve off of Dir.getwd as otherwise the symlink gets resolved!
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user