zillabyte-cli 0.1.29 → 0.1.30

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
  SHA1:
3
- metadata.gz: 5235575359e55744ebc42c03b7f5f868100a3a5f
4
- data.tar.gz: 07e187fcdc5c7711ccb0dbc65c3b3bceaa7a9063
3
+ metadata.gz: e9e56f44ff01e3417f093c4c67b5da5bb015ecaf
4
+ data.tar.gz: e93688302a3f84c692fca0e25cf5f99407415267
5
5
  SHA512:
6
- metadata.gz: 7f70c1780f894248575b79a07d936f1032d551067582ba116965bb8ea081d82a03b43a9507aa9775fcc1d8fa4be8f0517411be5acd62de68743dc889ff3dba6b
7
- data.tar.gz: d2f4ae5612bc30c6546e61ffec0fbc67c163a3247ec5d99c9e39cbfa1088f1e7c18d97943790965b61c7833481a312b265a4850a9660a10ec42f983d38b73d8b
6
+ metadata.gz: 4a74eb133a070285150df3f401215d1ac52b6bdfe0cf6925efebe6cd08eee769ee35069c0aa1eb56e89da7f2e20bbe172072e2a44c94c9c635aecb118edd782a
7
+ data.tar.gz: 4e0fc742cb3396d2f3ac9164898055247cb4e7c7a698782dafa9396545bd0b3a74d7a4be3a523d6d3e293404a7df3d329397382cb6b5f44cc4ddb036af8799a9
@@ -58,7 +58,7 @@ class Zillabyte::Command::Flows < Zillabyte::Command::Base
58
58
  # flows:push [DIR]
59
59
  #
60
60
  # Uploads a flow.
61
- #
61
+ # --force # Don't ask for confirmation
62
62
  # --config CONFIG_FILE # Use the given config file
63
63
  # --directory DIR # Flow directory
64
64
  # --output_type OUTPUT_TYPE # Specify an output type i.e. json #HIDDEN
@@ -73,6 +73,7 @@ class Zillabyte::Command::Flows < Zillabyte::Command::Base
73
73
  end
74
74
  options[:directory] = dir
75
75
  type = options[:output_type]
76
+ forced = options[:force]
76
77
 
77
78
  # Get the meta info
78
79
  require('zillabyte/api/flows')
@@ -87,6 +88,34 @@ class Zillabyte::Command::Flows < Zillabyte::Command::Base
87
88
  end
88
89
 
89
90
  flow_type = hash["flow_type"]
91
+ flow_name = hash["name"]
92
+
93
+ # Before killing live flow (with same name), ask for confirmation before push unless force flag is on
94
+ if !forced
95
+ if flow_type == "app"
96
+ flows = api.app.list
97
+ else
98
+ flows = api.component.list
99
+ end
100
+ flows.each do |flow|
101
+ if flow_name == flow["name"]
102
+ if flow["state"] == "RUNNING"
103
+ display "An app/component with this name is already running. If you continue to push, the running app/component with this name will be terminated. Would you like to continue to push?[y/N]", false
104
+
105
+ input = ask
106
+
107
+ if !(input.downcase == "y" || input.downcase == "yes")
108
+ return
109
+
110
+ end
111
+ end
112
+ break
113
+ end
114
+ end
115
+ end
116
+
117
+
118
+
90
119
 
91
120
  res = api.flows.push_directory dir, hash, session, options
92
121
 
@@ -1,5 +1,5 @@
1
1
  module Zillabyte
2
2
  module CLI
3
- VERSION = "0.1.29"
3
+ VERSION = "0.1.30"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zillabyte-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.29
4
+ version: 0.1.30
5
5
  platform: ruby
6
6
  authors:
7
7
  - zillabyte