aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Formula')
-rw-r--r--Library/Formula/pass.rb19
1 files changed, 18 insertions, 1 deletions
diff --git a/Library/Formula/pass.rb b/Library/Formula/pass.rb
index 082b6ea1b..23bf0abc7 100644
--- a/Library/Formula/pass.rb
+++ b/Library/Formula/pass.rb
@@ -1,5 +1,22 @@
require 'formula'
+class GpgRequirement < Requirement
+ fatal true
+ default_formula 'gnupg2'
+
+ satisfy do
+ %w(gpg gpg2).any? { |gpg| which gpg }
+ end
+
+ def message; <<-EOS.undent
+ pass requires GPG to be installed. Please install GPG in one of three ways:
+ - Install the gnupg2 package through Homebrew
+ - Install the gpgtools package through Homebrew Cask
+ - Download and install gpgtools from https://gpgtools.org/
+ EOS
+ end
+end
+
class Pass < Formula
homepage 'http://www.passwordstore.org/'
url 'http://git.zx2c4.com/password-store/snapshot/password-store-1.6.3.tar.xz'
@@ -17,7 +34,7 @@ class Pass < Formula
depends_on 'pwgen'
depends_on 'tree'
depends_on 'gnu-getopt'
- depends_on 'gnupg2'
+ depends_on GpgRequirement
def install
system "make DESTDIR=#{prefix} PREFIX=/ install"