terraspace 0.2.3 → 0.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bfffe08e9ea588c9c01b6e6bfb0c3399047391acf17eac9d74c8d4643ba4722b
4
- data.tar.gz: f887084702cab528ef80c786bbacf5ce5e7e7f56938b96bce2cc4c85da8d0549
3
+ metadata.gz: 7bd8fdab16c165766aaf3ab1d6cb3fdf2011d8ed02ac7bf713bc7dd51de862ea
4
+ data.tar.gz: b6364f9921e3330096b6a3276d6e35cf5ad26a27d70f911afac3dc33e2c4287e
5
5
  SHA512:
6
- metadata.gz: fe9ec67940c66eaf3f091b2e9dc7eaec2252ad8e1b134c11faaf4fc03befdb840c2e5222cf6204d879d6b5f0221f506457245910c236785c0caee8c58528352d
7
- data.tar.gz: 725d3091bad4ea62ccb7e9fbb49dcb124c235e5ec810278b301fa859ba3c9721f8b616528cb777dd5e17a233b66bc6804ecef605b922364e8634b3e16a4204c9
6
+ metadata.gz: 2066770e8e6d31dc93986d3684f065f1b9f087e1b266cd01b999ad9f4d878bd497fce0efe656586d7b3fafa94ce859d7c8c4112be034d63a30393e46c0307d9c
7
+ data.tar.gz: b65e842ae15a0a08f6fa64c440155ac9961f8ed52a6f1ecb4d020806943b2860cb7c7073cd344a2e33ebe5984f2c05abdea2f75e2cb2da4f9323d799920f6ee8
@@ -3,6 +3,9 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  This project *loosely tries* to adhere to [Semantic Versioning](http://semver.org/), even before v1.0.
5
5
 
6
+ ## [0.2.4]
7
+ - fix version check for some versions of terraform
8
+
6
9
  ## [0.2.3]
7
10
  * #37 config.clean_cache option
8
11
 
@@ -23,15 +23,21 @@ class Terraspace::CLI
23
23
  end
24
24
 
25
25
  def check_required_version!
26
- puts "Terraspace requires Terraform v#{REQUIRED_TERRAFORM_VERSION}.x"
26
+ puts "Terraspace requires Terraform v#{REQUIRED_TERRAFORM_VERSION}.x and above"
27
27
  if ok?
28
28
  puts "You're all set!"
29
29
  else
30
- puts "The installed version of terraform may not work with terraspace. Recommend using terraform v#{REQUIRED_TERRAFORM_VERSION}.x"
31
- exit 1
30
+ puts "The installed version of terraform may not work with terraspace."
31
+ puts "Recommend using at least terraform v#{REQUIRED_TERRAFORM_VERSION}.x"
32
+ puts "If you would like to bypass this check. Use TS_VERSION_CHECK=0" unless check_command?
33
+ exit 1 unless ENV['TS_VERSION_CHECK'] == '0'
32
34
  end
33
35
  end
34
36
 
37
+ def check_command?
38
+ ARGV[0] == "check_setup"
39
+ end
40
+
35
41
  def ok?
36
42
  version = terraform_version_message.sub(/.*v/,'') # => 0.12.24
37
43
  major, minor, _ = version.split('.')
@@ -47,7 +53,8 @@ class Terraspace::CLI
47
53
  end
48
54
  memoize :terraform_bin
49
55
 
50
- # First line contains the Terraform version info:
56
+ # Sometimes Terraform shows the version info on the first line and sometimes on the bottom line.
57
+ # Account for that by finding the line.
51
58
  #
52
59
  # $ terraform --version
53
60
  # Terraform v0.12.24
@@ -56,7 +63,7 @@ class Terraspace::CLI
56
63
  # is 0.12.26. You can update by downloading from https://www.terraform.io/downloads.html
57
64
  #
58
65
  def terraform_version_message
59
- `terraform --version`.split("\n").first.strip
66
+ `terraform --version`.split("\n").find { |l| l =~ /^Terraform / }.strip
60
67
  end
61
68
  memoize :terraform_version_message
62
69
 
@@ -1,3 +1,3 @@
1
1
  module Terraspace
2
- VERSION = "0.2.3"
2
+ VERSION = "0.2.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: terraspace
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tung Nguyen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-09-06 00:00:00.000000000 Z
11
+ date: 2020-09-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport