Shopify / shopify-cli

Shopify CLI helps you build against the Shopify platform faster.
https://shopify.dev/tools/cli
Other
1.01k stars 201 forks source link

Introduce hidden `--overwrite-json` flag #2724

Closed Poitrin closed 1 year ago

Poitrin commented 1 year ago

WHY are these changes introduced?

Part of https://github.com/Shopify/internal-cli-foundations/issues/509 Is required by https://github.com/Shopify/cli/pull/1169

Issue https://github.com/Shopify/shopify-cli/issues/2433 was fixed with https://github.com/Shopify/shopify-cli/pull/2463. With https://github.com/Shopify/cli/pull/1169, Node CLI needs to pass Ruby CLI a hidden flag to differentiate themes created at runtime.

WHAT is this pull request doing?

Introduces --overwrite-json flag that Node CLI can pass to Ruby CLI.

How to test your changes?

  1. In lib/shopify_cli/theme/theme.rb, remove the line @created_at_runtime = true, because theme will already have been created by Node CLI.
  2. Make sure that your current store has 0 development themes.
  3. Execute shopify(-dev) theme serve /path/to/theme --theme-editor-sync
  4. Verify that CLI asks "Keep the remote version".
  5. Exit the prompt.
  6. Delete the development theme that has been created.
  7. Execute shopify(-dev) theme serve /path/to/theme --theme-editor-sync --overwrite-json
  8. Verify that CLI does not display any prompt.

Post-release steps

Update checklist