shopify-cli 0.9.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +24 -4
  3. data/docs/getting-started/install/index.md +37 -1
  4. data/docs/getting-started/migrate/index.md +34 -1
  5. data/lib/project_types/extension/cli.rb +1 -1
  6. data/lib/project_types/extension/commands/build.rb +1 -1
  7. data/lib/project_types/node/forms/create.rb +3 -54
  8. data/lib/project_types/node/messages/messages.rb +3 -14
  9. data/lib/project_types/rails/cli.rb +0 -1
  10. data/lib/project_types/rails/forms/create.rb +3 -52
  11. data/lib/project_types/rails/messages/messages.rb +2 -13
  12. data/lib/project_types/script/cli.rb +2 -3
  13. data/lib/project_types/script/commands/create.rb +4 -4
  14. data/lib/project_types/script/commands/disable.rb +4 -14
  15. data/lib/project_types/script/commands/enable.rb +35 -11
  16. data/lib/project_types/script/commands/push.rb +9 -9
  17. data/lib/project_types/script/config/extension_points.yml +9 -3
  18. data/lib/project_types/script/forms/script_form.rb +5 -2
  19. data/lib/project_types/script/layers/application/create_script.rb +7 -6
  20. data/lib/project_types/script/layers/application/disable_script.rb +9 -7
  21. data/lib/project_types/script/layers/application/enable_script.rb +11 -9
  22. data/lib/project_types/script/layers/application/push_script.rb +6 -4
  23. data/lib/project_types/script/layers/infrastructure/assemblyscript_project_creator.rb +2 -2
  24. data/lib/project_types/script/layers/infrastructure/assemblyscript_task_runner.rb +2 -2
  25. data/lib/project_types/script/layers/infrastructure/errors.rb +1 -0
  26. data/lib/project_types/script/layers/infrastructure/push_package_repository.rb +1 -1
  27. data/lib/project_types/script/layers/infrastructure/script_repository.rb +1 -1
  28. data/lib/project_types/script/layers/infrastructure/script_service.rb +2 -0
  29. data/lib/project_types/script/messages/messages.rb +16 -19
  30. data/lib/project_types/script/script_project.rb +8 -4
  31. data/lib/project_types/script/templates/ts/as-pect.config.js +6 -0
  32. data/lib/project_types/script/ui/error_handler.rb +4 -0
  33. data/lib/project_types/script/ui/printing_spinner.rb +75 -0
  34. data/lib/shopify-cli/admin_api.rb +1 -2
  35. data/lib/shopify-cli/admin_api/populate_resource_command.rb +10 -1
  36. data/lib/shopify-cli/admin_api/schema.rb +20 -8
  37. data/lib/shopify-cli/command.rb +2 -5
  38. data/lib/shopify-cli/commands.rb +1 -0
  39. data/lib/shopify-cli/commands/config.rb +44 -0
  40. data/lib/shopify-cli/commands/connect.rb +18 -11
  41. data/lib/shopify-cli/commands/create.rb +1 -1
  42. data/lib/shopify-cli/commands/help.rb +1 -1
  43. data/lib/shopify-cli/commands/system.rb +1 -1
  44. data/lib/shopify-cli/context.rb +10 -1
  45. data/lib/shopify-cli/core.rb +0 -1
  46. data/lib/shopify-cli/core/entry_point.rb +6 -0
  47. data/lib/shopify-cli/core/finalize.rb +13 -0
  48. data/lib/shopify-cli/feature.rb +97 -0
  49. data/lib/shopify-cli/messages/messages.rb +45 -2
  50. data/lib/shopify-cli/partners_api/organizations.rb +7 -7
  51. data/lib/shopify-cli/project_type.rb +2 -5
  52. data/lib/shopify-cli/tasks.rb +1 -0
  53. data/lib/shopify-cli/tasks/ensure_env.rb +0 -1
  54. data/lib/shopify-cli/tasks/select_org_and_shop.rb +77 -0
  55. data/lib/shopify-cli/tasks/update_dashboard_urls.rb +4 -3
  56. data/lib/shopify-cli/tunnel.rb +33 -9
  57. data/lib/shopify-cli/version.rb +1 -1
  58. data/lib/shopify_cli.rb +1 -0
  59. metadata +7 -4
  60. data/lib/project_types/script/forms/enable.rb +0 -24
  61. data/lib/project_types/script/forms/push.rb +0 -19
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e0d2feda9dda6ab4615cc2c15d8afb30f33cac588acd3f2672cd7456e4ad4fd8
4
- data.tar.gz: 0b2ad4137e51ab352a41719e370b98fe147062386c6696f0be9a59bf884c1954
3
+ metadata.gz: d17f3e09b5ecfa047387eb3786b187bbb4e03068a28b71815c62a338e4d3b3a0
4
+ data.tar.gz: e7ae1f805df2f928ae5b1c043d9b864fc8151750f1869d4d23d8a73757ecbba0
5
5
  SHA512:
6
- metadata.gz: 0564124577f1f85d2597250792c27e3de0eda4a02fcb7ba6f9dd8b7b2a3bf36492e6b7a3dce9d48b946af8bfb81f3f39e3d0fa06966082f40b0232e5d8597e8b
7
- data.tar.gz: 07f8d25b7e123b5d9c09de7cd49a31017174e9a7251d50ca461381d06219b0560f6223e9d1dd3d89cd273b65965ab42eb1b007fe6151d9cfcff32bf4d16b3b0e
6
+ metadata.gz: 609ad36002ecb5b13d41cb4c6a0cfb397e18087878372acc59e3f3520fad32eb59d661f122307ac95b0d456c216327da317f9c30a26bfdd360370cc5f0aede1d
7
+ data.tar.gz: '094c183b361bd503a15d87e89b37c065361b78b3cfa69902a8176644c4f1d67c3890902889a069dc4049bd5a22ec4e6b9af258f19e12a0fc9a4e10aa72bab7e3'
@@ -1,18 +1,38 @@
1
- Version 0.9.3
1
+ Version 1.0.4
2
+ ------
3
+ * Fix a bug when running the `connect` command with an account with multiple organizations
4
+
5
+ Version 1.0.3
6
+ ------
7
+ * Fix a bug which causes an error in the `populate` and `generate` commands when prompting for the shop name
8
+
9
+ Version 1.0.2
10
+ ------
11
+ * Fix missing shop parameter to AdminAPI.query() call (impacting populate and generate commands)
12
+
13
+ Version 1.0.1
14
+ ------
15
+ * Fixed an issue with RVM taking over the shell shim fd when it was not in use
16
+
17
+ Version 1.0.0
18
+ ------
19
+ * Release the installer-based version of the CLI
20
+
21
+ Version 0.9.3 - Internal Test Version
2
22
  ------
3
23
  * Rebased to master
4
24
  * Removed auto-generated files from builds directory
5
25
 
6
- Version 0.9.2
26
+ Version 0.9.2 - Internal Test Version
7
27
  ------
8
28
  * Rebased to master, to pull in 7+ Pull Requests
9
29
  * Updates to dependencies to package files (updated Ruby version)
10
30
 
11
- Version 0.9.1
31
+ Version 0.9.1 - Internal Test Version
12
32
  ------
13
33
  * Updated required Ruby version for the CLI
14
34
  * Minor fixes for the build / release process
15
35
 
16
- Version 0.9.0
36
+ Version 0.9.0 - Internal Test Version
17
37
  ------
18
38
  * Initial test release of gem-based CLI
@@ -36,4 +36,40 @@ $ sudo yum install shopify-cli-x.y.x.rpm
36
36
 
37
37
  ```console
38
38
  $ gem install shopify-cli
39
- ```
39
+ ```
40
+
41
+ ### To check that Shopify App CLI is installed correctly:
42
+
43
+ ```console
44
+ $ shopify version
45
+ 1.0.0
46
+ $
47
+ ```
48
+
49
+ > Note 1: the version displayed may be newer.
50
+
51
+ > Note 2: If you have the `shopify_api` gem installed, you may see the following response:
52
+ > ```console
53
+ > shopify command is no longer bundled with shopify_api.
54
+ > if you need these tools, install the shopify_cli gem
55
+ > ```
56
+ >
57
+ > If so, then you will also need to upgrade the `shopify_api` gem to v9.2.0+ to remove a deprecated `shopify` command that is contained in that gem.
58
+ >
59
+ > If you also have the `shopify_app` gem (which depends on `shopify_api` gem), you'll need to install or update `shopify_api` first, then uninstall the older version.
60
+ >
61
+ > To get a list of the version(s) of `shopify_api` currently installed:
62
+ > ```console
63
+ > $ gem list shopify_api
64
+ > ```
65
+ >
66
+ > To install the latest version:
67
+ > ```console
68
+ > $ gem install shopify_api
69
+ > ```
70
+ >
71
+ > To uninstall the older version:
72
+ > ```console
73
+ > $ gem uninstall shopify_api -v x.y.z
74
+ > ```
75
+ > Replace x.y.z with a version number listed from the `gem list` command. Repeat as needed.
@@ -22,6 +22,7 @@ There are two steps to completely uninstall the legacy version of Shopify App CL
22
22
 
23
23
  1. Delete the legacy CLI files
24
24
  1. Remove the legacy `shopify` command from your shell profile
25
+ 1. Reload your terminal
25
26
 
26
27
  ### 1. Delete the CLI files
27
28
 
@@ -51,7 +52,39 @@ if [[ -f /HOME_DIR/.shopify-cli/shopify.sh ]]; then source /HOME_DIR/.shopify-cl
51
52
  [ -f "/HOME_DIR/.shopify-app-cli/shopify.sh" ] && source "/HOME_DIR/.shopify-app-cli/shopify.sh"
52
53
  ```
53
54
 
54
- Deleting or commenting out the relevant line in your shell profile will remove `shopify` as a command. You may need to reload your shell.
55
+ Deleting or commenting out the relevant line in your shell profile will remove `shopify` as a command.
56
+
57
+ ### 3. Reload your terminal
58
+
59
+ For the changes above to take effect, exit your terminal, and start a new one.
60
+
61
+ If you try running `shopify` now, you should get a `command not found` error.
62
+
63
+ > If you have the `shopify_api` gem installed, you may see the following response:
64
+ > ```console
65
+ > shopify command is no longer bundled with shopify_api.
66
+ > if you need these tools, install the shopify_cli gem
67
+ > ```
68
+ >
69
+ > If so, then you will also need to upgrade the `shopify_api` gem to v9.2.0+ to remove a deprecated `shopify` command that is contained in that gem.
70
+ >
71
+ > If you also have the `shopify_app` gem (which depends on `shopify_api` gem), you'll need to install or update `shopify_api` first, then uninstall the older version.
72
+ >
73
+ > To get a list of the version(s) of `shopify_api` currently installed:
74
+ > ```console
75
+ > $ gem list shopify_api
76
+ > ```
77
+ >
78
+ > To install the latest version:
79
+ > ```console
80
+ > $ gem install shopify_api
81
+ > ```
82
+ >
83
+ > To uninstall the older version:
84
+ > ```console
85
+ > $ gem uninstall shopify_api -v x.y.z
86
+ > ```
87
+ > Replace x.y.z with a version number listed from the `gem list` command. Repeat as needed.
55
88
 
56
89
  ## 2. Install the new version
57
90
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Extension
4
4
  class Project < ShopifyCli::ProjectType
5
- hidden_project_type
5
+ hidden_feature
6
6
  creator 'App Extension', 'Extension::Commands::Create'
7
7
 
8
8
  register_command('Extension::Commands::Build', "build")
@@ -4,7 +4,7 @@ require 'shopify_cli'
4
4
  module Extension
5
5
  module Commands
6
6
  class Build < ExtensionCommand
7
- hidden_command
7
+ hidden_feature
8
8
 
9
9
  YARN_BUILD_COMMAND = %w(build)
10
10
  NPM_BUILD_COMMAND = %w(run-script build)
@@ -10,8 +10,9 @@ module Node
10
10
  self.title ||= CLI::UI::Prompt.ask(ctx.message('node.forms.create.app_name'))
11
11
  self.type = ask_type
12
12
  self.name = self.title.downcase.split(" ").join("_")
13
- self.organization_id ||= organization["id"].to_i
14
- self.shop_domain ||= ask_shop_domain
13
+ res = ShopifyCli::Tasks::SelectOrgAndShop.call(ctx, organization_id: organization_id, shop_domain: shop_domain)
14
+ self.organization_id = res[:organization_id]
15
+ self.shop_domain = res[:shop_domain]
15
16
  end
16
17
 
17
18
  private
@@ -30,58 +31,6 @@ module Node
30
31
  ctx.puts(ctx.message('node.forms.create.app_type.selected', type))
31
32
  type
32
33
  end
33
-
34
- def organizations
35
- @organizations ||= ShopifyCli::PartnersAPI::Organizations.fetch_all(ctx)
36
- end
37
-
38
- def organization
39
- @organization ||= if !organization_id.nil?
40
- org = ShopifyCli::PartnersAPI::Organizations.fetch(ctx, id: organization_id)
41
- if org.nil?
42
- ctx.puts(ctx.message('node.forms.create.authentication_issue', ShopifyCli::TOOL_NAME))
43
- ctx.abort(ctx.message('node.forms.create.error.organization_not_found'))
44
- end
45
- org
46
- elsif organizations.count == 0
47
- ctx.puts(ctx.message('node.forms.create.partners_notice'))
48
- ctx.puts(ctx.message('node.forms.create.authentication_issue', ShopifyCli::TOOL_NAME))
49
- ctx.abort(ctx.message('node.forms.create.error.no_organizations'))
50
- elsif organizations.count == 1
51
- org = organizations.first
52
- ctx.puts(ctx.message('node.forms.create.organization',
53
- ctx.message('core.partners_api.org_name_and_id', org['businessName'], org['id'])))
54
- org
55
- else
56
- org_id = CLI::UI::Prompt.ask(ctx.message('node.forms.create.organization_select')) do |handler|
57
- organizations.each do |o|
58
- handler.option(ctx.message('core.partners_api.org_name_and_id', o['businessName'], o['id'])) { o['id'] }
59
- end
60
- end
61
- organizations.find { |o| o['id'] == org_id }
62
- end
63
- end
64
-
65
- def ask_shop_domain
66
- valid_stores = organization['stores'].select do |store|
67
- store['transferDisabled'] == true || store['convertableToPartnerTest'] == true
68
- end
69
-
70
- if valid_stores.count == 0
71
- ctx.puts(ctx.message('node.forms.create.no_development_stores'))
72
- ctx.puts(ctx.message('node.forms.create.create_store', organization['id']))
73
- ctx.puts(ctx.message('node.forms.create.authentication_issue', ShopifyCli::TOOL_NAME))
74
- elsif valid_stores.count == 1
75
- domain = valid_stores.first['shopDomain']
76
- ctx.puts(ctx.message('node.forms.create.development_store', domain))
77
- domain
78
- else
79
- CLI::UI::Prompt.ask(
80
- ctx.message('node.forms.create.development_store_select'),
81
- options: valid_stores.map { |s| s['shopDomain'] }
82
- )
83
- end
84
- end
85
34
  end
86
35
  end
87
36
  end
@@ -28,8 +28,8 @@ module Node
28
28
  },
29
29
  info: {
30
30
  created: "{{v}} {{green:%s}} was created in your Partner Dashboard {{underline:%s}}",
31
- serve: "{{*}} Change into your new project folder {{green:%s}} and run {{command:%s serve}} to start a " \
32
- "local server",
31
+ serve: "{{*}} Change directories to your new project folder {{green:%s}} and run {{command:%s serve}} " \
32
+ "to start a local server",
33
33
  install: "{{*}} Then, visit {{underline:%s/test}} to install {{green:%s}} on your Dev Store",
34
34
  },
35
35
  node_version: "node %s",
@@ -233,25 +233,14 @@ module Node
233
233
  create: {
234
234
  error: {
235
235
  invalid_app_type: "Invalid app type %s",
236
- organization_not_found: "Cannot find a partner organization with that ID",
237
- no_organizations: "No partner organizations available.",
238
236
  },
239
-
240
- authentication_issue: "For authentication issues, run {{command:%s logout}} to clear invalid credentials",
241
- partners_notice: "Please visit https://partners.shopify.com/ to create a partners account",
242
- no_development_stores: "{{x}} No Development Stores available.",
243
- create_store: "Visit {{underline:https://partners.shopify.com/%s/stores}} to create one",
244
- app_name: "App Name",
237
+ app_name: "App name",
245
238
  app_type: {
246
239
  select: "What type of app are you building?",
247
240
  select_public: "Public: An app built for a wide merchant audience.",
248
241
  select_custom: "Custom: An app custom built for a single client.",
249
242
  selected: "App type {{green:%s}}",
250
243
  },
251
- organization_select: "Select partner organization",
252
- organization: "Partner organization {{green:%s}}",
253
- development_store_select: "Select a development store",
254
- development_store: "Using development store {{green:%s}}",
255
244
  },
256
245
  },
257
246
  },
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  module Rails
3
3
  class Project < ShopifyCli::ProjectType
4
- # hidden_project_type
5
4
  creator 'Ruby on Rails App', 'Rails::Commands::Create'
6
5
 
7
6
  register_command('Rails::Commands::Deploy', "deploy")
@@ -22,8 +22,9 @@ module Rails
22
22
  self.title ||= CLI::UI::Prompt.ask(ctx.message('rails.forms.create.app_name'))
23
23
  self.type = ask_type
24
24
  self.name = self.title.downcase.split(" ").join("_")
25
- self.organization_id ||= organization["id"].to_i
26
- self.shop_domain ||= ask_shop_domain
25
+ res = ShopifyCli::Tasks::SelectOrgAndShop.call(ctx, organization_id: organization_id, shop_domain: shop_domain)
26
+ self.organization_id = res[:organization_id]
27
+ self.shop_domain = res[:shop_domain]
27
28
  self.db = ask_db
28
29
  end
29
30
 
@@ -44,56 +45,6 @@ module Rails
44
45
  type
45
46
  end
46
47
 
47
- def organizations
48
- @organizations ||= ShopifyCli::PartnersAPI::Organizations.fetch_all(ctx)
49
- end
50
-
51
- def organization
52
- @organization ||= if !organization_id.nil?
53
- org = ShopifyCli::PartnersAPI::Organizations.fetch(ctx, id: organization_id)
54
- if org.nil?
55
- ctx.puts(ctx.message('rails.forms.create.authentication_issue', ShopifyCli::TOOL_NAME))
56
- ctx.abort(ctx.message('rails.forms.create.error.organization_not_found'))
57
- end
58
- org
59
- elsif organizations.count == 0
60
- ctx.puts(ctx.message('rails.forms.create.partners_notice'))
61
- ctx.puts(ctx.message('rails.forms.create.authentication_issue', ShopifyCli::TOOL_NAME))
62
- ctx.abort(ctx.message('rails.forms.create.error.no_organizations'))
63
- elsif organizations.count == 1
64
- org = organizations.first
65
- ctx.puts(ctx.message('rails.forms.create.organization',
66
- ctx.message('core.partners_api.org_name_and_id', org['businessName'], org['id'])))
67
- org
68
- else
69
- org_id = CLI::UI::Prompt.ask(ctx.message('rails.forms.create.organization_select')) do |handler|
70
- organizations.each { |o| handler.option(o['businessName']) { o['id'] } }
71
- end
72
- organizations.find { |o| o['id'] == org_id }
73
- end
74
- end
75
-
76
- def ask_shop_domain
77
- valid_stores = organization['stores'].select do |store|
78
- store['transferDisabled'] == true || store['convertableToPartnerTest'] == true
79
- end
80
-
81
- if valid_stores.count == 0
82
- ctx.puts(ctx.message('rails.forms.create.no_development_stores'))
83
- ctx.puts(ctx.message('rails.forms.create.create_store', organization['id']))
84
- ctx.puts(ctx.message('rails.forms.create.authentication_issue', ShopifyCli::TOOL_NAME))
85
- elsif valid_stores.count == 1
86
- domain = valid_stores.first['shopDomain']
87
- ctx.puts(ctx.message('rails.forms.create.development_store', domain))
88
- domain
89
- else
90
- CLI::UI::Prompt.ask(
91
- ctx.message('rails.forms.create.development_store_select'),
92
- options: valid_stores.map { |s| s['shopDomain'] }
93
- )
94
- end
95
- end
96
-
97
48
  def ask_db
98
49
  if db.nil?
99
50
  return 'sqlite3' unless CLI::UI::Prompt.confirm(ctx.message('rails.forms.create.db.want_select'),
@@ -37,8 +37,8 @@ module Rails
37
37
 
38
38
  info: {
39
39
  created: "{{v}} {{green:%s}} was created in your Partner Dashboard {{underline:%s}}",
40
- serve: "{{*}} Change into your new project folder {{green:%s}} and run {{command:%s serve}} to start a " \
41
- "local server",
40
+ serve: "{{*}} Change directories to your new project folder {{green:%s}} and run {{command:%s serve}} " \
41
+ "to start a local server",
42
42
  install: "{{*}} Then, visit {{underline:%s/test}} to install {{green:%s}} on your Dev Store",
43
43
  },
44
44
  installing_bundler: "Installing bundler…",
@@ -236,14 +236,7 @@ module Rails
236
236
  error: {
237
237
  invalid_app_type: "Invalid app type %s",
238
238
  invalid_db_type: "Invalid database type %s",
239
- organization_not_found: "Cannot find a partner organization with that ID",
240
- no_organizations: "No partner organizations available.",
241
239
  },
242
-
243
- authentication_issue: "For authentication issues, run {{command:%s logout}} to clear invalid credentials",
244
- partners_notice: "Please visit https://partners.shopify.com/ to create a partners account",
245
- no_development_stores: "{{x}} No development stores available.",
246
- create_store: "Visit {{underline:https://partners.shopify.com/%s/stores}} to create one",
247
240
  app_name: "App name",
248
241
  app_type: {
249
242
  select: "What type of app are you building?",
@@ -271,10 +264,6 @@ module Rails
271
264
  select_jdbc: "JDBC",
272
265
  selected: "Database Type {{green:%s}}",
273
266
  },
274
- organization_select: "Select partner organization",
275
- organization: "Partner organization {{green:%s}}",
276
- development_store_select: "Select a development store",
277
- development_store: "Using development store {{green:%s}}",
278
267
  },
279
268
  },
280
269
  },
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Script
4
4
  class Project < ShopifyCli::ProjectType
5
- hidden_project_type
5
+ hidden_feature(feature_set: :script_project)
6
6
  creator 'Script', 'Script::Commands::Create'
7
7
 
8
8
  register_command('Script::Commands::Push', 'push')
@@ -24,8 +24,6 @@ module Script
24
24
  # define/autoload project specific Forms
25
25
  module Forms
26
26
  autoload :Create, Project.project_filepath('forms/create')
27
- autoload :Push, Project.project_filepath('forms/push')
28
- autoload :Enable, Project.project_filepath('forms/enable')
29
27
  autoload :ScriptForm, Project.project_filepath('forms/script_form')
30
28
  end
31
29
 
@@ -66,6 +64,7 @@ module Script
66
64
 
67
65
  module UI
68
66
  autoload :ErrorHandler, Project.project_filepath('ui/error_handler')
67
+ autoload :PrintingSpinner, Project.project_filepath('ui/printing_spinner')
69
68
  autoload :StrictSpinner, Project.project_filepath('ui/strict_spinner')
70
69
  end
71
70
 
@@ -19,15 +19,15 @@ module Script
19
19
  return @ctx.puts(self.class.help)
20
20
  end
21
21
 
22
- Layers::Application::CreateScript.call(
22
+ project = Layers::Application::CreateScript.call(
23
23
  ctx: @ctx,
24
24
  language: language,
25
25
  script_name: form.name,
26
26
  extension_point_type: form.extension_point
27
27
  )
28
- project = ScriptProject.current
29
- @ctx.puts(@ctx.message('script.create.script_path', folder: project.script_name))
30
- @ctx.puts(@ctx.message('script.create.script_created', script_id: project.source_file))
28
+ @ctx.puts(@ctx.message('script.create.change_directory_notice', project.script_name))
29
+ rescue Script::Errors::ScriptProjectAlreadyExistsError => e
30
+ UI::ErrorHandler.pretty_print_and_raise(e, failed_op: @ctx.message('script.create.error.operation_failed'))
31
31
  rescue StandardError => e
32
32
  ScriptProject.cleanup(ctx: @ctx, script_name: form.name, root_dir: cur_dir) if form
33
33
  UI::ErrorHandler.pretty_print_and_raise(e, failed_op: @ctx.message('script.create.error.operation_failed'))
@@ -3,20 +3,14 @@
3
3
  module Script
4
4
  module Commands
5
5
  class Disable < ShopifyCli::Command
6
- options do |parser, flags|
7
- parser.on('--api_key=APIKEY') { |t| flags[:api_key] = t }
8
- parser.on('--shop_domain=MYSHOPIFYDOMAIN') { |t| flags[:shop_domain] = t }
9
- end
10
-
11
- def call(args, _name)
12
- form = Forms::Enable.ask(@ctx, args, options.flags)
13
- return @ctx.puts(self.class.help) unless form
6
+ prerequisite_task :ensure_env
14
7
 
8
+ def call(_args, _name)
15
9
  project = ScriptProject.current
16
10
  Layers::Application::DisableScript.call(
17
11
  ctx: @ctx,
18
- api_key: form.api_key,
19
- shop_domain: form.shop_domain,
12
+ api_key: project.env[:api_key],
13
+ shop_domain: project.env[:shop],
20
14
  extension_point_type: project.extension_point_type
21
15
  )
22
16
  @ctx.puts(@ctx.message('script.disable.script_disabled'))
@@ -27,10 +21,6 @@ module Script
27
21
  def self.help
28
22
  ShopifyCli::Context.message('script.disable.help', ShopifyCli::TOOL_NAME)
29
23
  end
30
-
31
- def self.extended_help
32
- ShopifyCli::Context.message('script.disable.extended_help', ShopifyCli::TOOL_NAME)
33
- end
34
24
  end
35
25
  end
36
26
  end