sonic-screwdriver 2.2.1 → 2.2.2

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: ca0ee2f6b882f119c6e607c3de2c38391c8c17236f9ef892211cb55e887c7c95
4
- data.tar.gz: a4592ac7afc7d3c875be3f02b26f5a884d2bd09423f518cf53fc5b027c963436
3
+ metadata.gz: 58baac92cd0720ee6f66d62b668d53eaf77a9b0bb184241dbbb69bdb2b7b120b
4
+ data.tar.gz: 593b326eee1fffa6da70b87f133a4cc1a61ae41b465962b5fa9077f1998c4dc5
5
5
  SHA512:
6
- metadata.gz: e4c02076435af8641128a6487769362b4a3cb4f428a88fe07f14cb0455f8a5ab3bf80ea1950748b9ea0690307e7c38f4f779165e01a3e5279801ad798e4b279f
7
- data.tar.gz: f0a7a5cea95e05190b5cf2fe767cc212d49e4063b9cfd4e04c18fb95ed20f2ae4b59b7bfe5a245b1616750aba6eb562ab53cddc196034af98977f8c25af56845
6
+ metadata.gz: 01b85739677b31d02caeb2c34a585fc2f711972ff086574b138f68b38ba156e9325dd0f8ba6fb76bd698f5b7bf422b4a1a11336f27b4695d2f2de153688dcc3b
7
+ data.tar.gz: d42107ab7218aab71cf6b500dc377e34a587b27155e696f729633a870b2788ab0807fc16c680c49083c99597ab466631b5e8f92b7d343a388379f5e2ce918c3c
data/CHANGELOG.md CHANGED
@@ -3,6 +3,9 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  This project *loosely* adheres to [Semantic Versioning](http://semver.org/), even before v1.0.
5
5
 
6
+ ## [2.2.2] - 2021-04-12
7
+ - [#11](https://github.com/boltops-tools/sonic/pull/11) cli check
8
+
6
9
  ## [2.2.1] - 2021-04-12
7
10
  - [#9](https://github.com/boltops-tools/sonic/pull/9) improve command array handling
8
11
 
data/lib/sonic/execute.rb CHANGED
@@ -58,13 +58,27 @@ module Sonic
58
58
 
59
59
  if status == "Success"
60
60
  puts "Command successful: #{status}".color(:green)
61
- exit(0)
61
+ exit_status(0)
62
62
  else
63
63
  puts "Command unsuccessful: #{status}".color(:red)
64
- exit(1)
64
+ exit_status(1)
65
65
  end
66
66
  end
67
67
 
68
+ def exit_status(code)
69
+ exit(code) unless cli?
70
+
71
+ if code == 0
72
+ true
73
+ else
74
+ raise "Error running command"
75
+ end
76
+ end
77
+
78
+ def cli?
79
+ $0.include?('sonic')
80
+ end
81
+
68
82
  def wait(command_id)
69
83
  ongoing_states = ["Pending", "InProgress", "Delayed"]
70
84
 
data/lib/sonic/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Sonic
2
- VERSION = "2.2.1"
2
+ VERSION = "2.2.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sonic-screwdriver
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.1
4
+ version: 2.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tung Nguyen