Created
March 3, 2011 10:17
-
-
Save uasi/852586 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb | |
index 0e32663..c2c8093 100644 | |
--- a/Library/Homebrew/formula.rb | |
+++ b/Library/Homebrew/formula.rb | |
@@ -312,8 +312,13 @@ class Formula | |
install_type = :from_url | |
else | |
# Check if this is a name or pathname | |
- path = Pathname.new(name) | |
- if path.absolute? | |
+ if name.include?("/") | |
+ path = Pathname.new(name) | |
+ # Resolve path if neccessary | |
+ if path.relative? | |
+ path = path.realpath(true) | |
+ name = path.to_s | |
+ end | |
# For absolute paths, just require the path | |
require name | |
name = path.stem |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment