terragov 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 852f92a97a49b1ed2bab8f9636c6633df8622915
4
- data.tar.gz: 15f60c7f8b84f9c3983c01acf67ee27cfa1e85f0
3
+ metadata.gz: 0d3187ea6e2507304bac2bb4d38e0efc7d012247
4
+ data.tar.gz: 33d452899677a07ea2f72c77d2e861327f060a87
5
5
  SHA512:
6
- metadata.gz: 3e13c77232c52712968e1d39a972f0c7f85459cf9aa0ccf2460604b51968c08fc889643d2de6ff79ede4b5571ca997f8527d6d30f0ac615d04aa68e5ee443278
7
- data.tar.gz: 586525da558af934a8f455dce68cce8032e84293abacd21382757674aa61e24261c46bf1c38a57573e588add6ac5ab2c0d4407e0f2f496f78686e38e176c1b61
6
+ metadata.gz: c6298dde09d8ca0292a442d3c182b7ac48f5568be61509fa62542a67aa39e9cd1c72ed7cdf192e2309fb0e380fe112bdd61f63a668c0f24660527f45adc19bd2
7
+ data.tar.gz: 67365897d0ffce2f81960b61a85a6807587be42ef816cacb0d2a5b91534f59416547370567d560e60308b4e030aee03df8f03707c3ee9b711d981ab57cd05507
@@ -4,8 +4,6 @@ require 'highline'
4
4
  module Terragov
5
5
  class Cleaner
6
6
  def delete(path, pattern, force=false)
7
- cli = HighLine.new
8
-
9
7
  files = Find.find(path).grep(pattern)
10
8
 
11
9
  if files.empty?
@@ -1,18 +1,23 @@
1
1
  module Terragov
2
2
  class Terraform
3
3
 
4
- def package_check
5
- unless system("which terraform >/dev/null")
6
- abort("Must install terraform")
7
- end
8
-
9
- unless system("which sops >/dev/null")
10
- abort("Must install sops")
4
+ def package_check(package)
5
+ unless system("which #{package} >/dev/null")
6
+ abort("Must install #{package}") unless HighLine.agree("Can't find #{package}. Install using Homebrew?")
7
+ if system("which brew >/dev/null")
8
+ system("brew install #{package}")
9
+ else
10
+ abort("Error: cannot find brew")
11
+ end
11
12
  end
12
13
  end
13
14
 
14
15
  def execute(command, vars, backend, directory, dryrun=false, verbose=false)
15
- package_check
16
+ packages = [ 'terraform', 'sops' ]
17
+
18
+ packages.each do |pkg|
19
+ package_check(pkg)
20
+ end
16
21
 
17
22
  if command == 'init'
18
23
  puts "Running 'init' is not required as it is applied for each command"
@@ -1,3 +1,3 @@
1
1
  module Terragov
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: terragov
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Laura Martin