aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/git-hg.rb
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Formula/git-hg.rb')
-rw-r--r--Library/Formula/git-hg.rb24
1 files changed, 18 insertions, 6 deletions
diff --git a/Library/Formula/git-hg.rb b/Library/Formula/git-hg.rb
index 153062fee..fac0be430 100644
--- a/Library/Formula/git-hg.rb
+++ b/Library/Formula/git-hg.rb
@@ -1,16 +1,28 @@
require 'formula'
+class HgInstalled < Requirement
+ def message; <<-EOS.undent
+ Mercurial is required to use this software.
+
+ You can install this with Homebrew using:
+ brew install mercurial
+
+ Or you can use an official installer from:
+ http://mercurial.selenic.com/
+ EOS
+ end
+ def satisfied?
+ which 'hg'
+ end
+end
+
class GitHg < Formula
head 'https://github.com/offbytwo/git-hg.git'
homepage 'http://offbytwo.com/git-hg/'
- def install
- unless which 'hg'
- puts "You may need to install Mercurial before using this software:"
- puts " brew install mercurial"
- end
+ depends_on HgInstalled.new
+ def install
prefix.install Dir['*']
end
end
-