shopify-cli 2.6.4 → 2.6.5

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
  SHA256:
3
- metadata.gz: 51b5808e81e2d168620af088bec6f155869a9870b516960927735f9b7b886e55
4
- data.tar.gz: 47c04e0dbabd30bb2c03e8c99771e724e16fe7c336fd342be01540749088bee5
3
+ metadata.gz: 8e55157b78cbbd9cd86e3d2e8c542241d7064de3fc4e37768f207dc8ee124f4c
4
+ data.tar.gz: 7b5aa9ae10f96a7724d4a0b0dd79712254ce3f99273a88c7e9198ec03f17ba7c
5
5
  SHA512:
6
- metadata.gz: d75f831a6214930264f60c6c5699beddba9ae73c834878723b2b6c764a5e98d30e427183fa6946fdf57c45a90859cc0a4bbd5420616a72b2f340c0c91093a430
7
- data.tar.gz: b73c3d43b0a711994930c0490de71bfeeeff0775b5e0ce6efc48c8c40935b630e5d0ed7182d6eb20188357199a469325b7b40f6cbf317dccb34655745e315ef6
6
+ metadata.gz: b526446476543316cdd68a40cc5e28af1a0bd0d823757b53901c39b9e2f510a8fb9e9edd52f7fc967df44603d17d9092e95b375e12618f86f6261f45217b4802
7
+ data.tar.gz: 7ee68c03b039974c59d0cbc50ad866faf52ec436fe66b17c1a79e801c4ed1854ddf13fb82274e79e2917c5d63c0066b048d1255d4a3019349dd559b402d12cd8
data/CHANGELOG.md CHANGED
@@ -1,6 +1,9 @@
1
1
  From version 2.6.0, the sections in this file adhere to the [keep a changelog](https://keepachangelog.com/en/1.0.0/) specification.
2
2
  ## [Unreleased]
3
3
 
4
+ ## Version 2.6.5
5
+ ### Fixed
6
+ * [#1661](https://github.com/Shopify/shopify-cli/pull/1661): Handle npm list non-zero exit status when pushing scripts
4
7
  ## Version 2.6.4
5
8
  ### Fixed
6
9
  * [#1633](https://github.com/Shopify/shopify-cli/pull/1633): Runtime error when the shop passed on login is invalid
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- shopify-cli (2.6.4)
4
+ shopify-cli (2.6.5)
5
5
  bugsnag (~> 6.22)
6
6
  listen (~> 3.7.0)
7
7
  theme-check (~> 1.7.2)
@@ -49,12 +49,31 @@ module Script
49
49
 
50
50
  def library_version(library_name)
51
51
  output = JSON.parse(CommandRunner.new(ctx: ctx).call("npm list --json"))
52
- raise Errors::APILibraryNotFoundError.new(library_name), output unless output["dependencies"][library_name]
53
- output["dependencies"][library_name]["version"]
52
+ library_version_from_npm_list(output, library_name)
53
+ rescue Errors::SystemCallFailureError => error
54
+ library_version_from_npm_list_error_output(error, library_name)
54
55
  end
55
56
 
56
57
  private
57
58
 
59
+ def library_version_from_npm_list_error_output(error, library_name)
60
+ # npm list can return a failure status code, even when returning the correct data.
61
+ # This causes the CommandRunner to throw a SystemCallFailure error that contains the data.
62
+ # In here, we check that the output contains `npm list`'s structure and extract the version.
63
+ output = JSON.parse(error.out)
64
+ raise error unless output.key?("dependencies")
65
+
66
+ library_version_from_npm_list(output, library_name)
67
+ rescue JSON::ParserError
68
+ raise error
69
+ end
70
+
71
+ def library_version_from_npm_list(output, library_name)
72
+ output.dig("dependencies", library_name, "version").tap do |version|
73
+ raise Errors::APILibraryNotFoundError, library_name unless version
74
+ end
75
+ end
76
+
58
77
  def check_node_version!
59
78
  output, status = @ctx.capture2e("node", "--version")
60
79
  raise Errors::DependencyInstallError, output unless status.success?
@@ -212,10 +212,6 @@ module Script
212
212
  built: "Built",
213
213
  pushing: "Pushing",
214
214
  pushed: "Pushed",
215
- disabling: "Disabling",
216
- disabled: "Disabled",
217
- enabling: "Enabling",
218
- enabled: "Enabled",
219
215
  ensure_env: {
220
216
  organization: "Partner organization {{green:%s (%s)}}.",
221
217
  organization_select: "Which partner organization do you want to use?",
@@ -1,3 +1,3 @@
1
1
  module ShopifyCLI
2
- VERSION = "2.6.4"
2
+ VERSION = "2.6.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shopify-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.4
4
+ version: 2.6.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shopify
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-10-18 00:00:00.000000000 Z
11
+ date: 2021-10-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler