Skip to content
This repository was archived by the owner on Jun 1, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ From version 2.6.0, the sections in this file adhere to the [keep a changelog](h

## [Unreleased]

### Fixed
* [#2735](https://github.com/Shopify/shopify-cli/pull/2735): Remove theme directory confirmation during tests and make confirmation dialogue respect `SHOPIFY_CLI_TTY` (from cli#1369)

### Added
* [#2735](https://github.com/Shopify/shopify-cli/pull/2735): Pass development theme from CLI 3’s to CLI 2’s local storage (from cli#1410)

## Version 2.35.0 - 2023-02-22

### Fixed
Expand Down
5 changes: 3 additions & 2 deletions lib/project_types/theme/commands/common/root_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,14 @@ def exist_and_not_empty?(root)
private

def current_directory_confirmed?
raise "Current theme directory can't be confirmed during tests" if @ctx.testing?
return true if options.flags[:force]

@ctx.warn(@ctx.message("theme.current_directory_is_not_theme_directory"))
Forms::ConfirmStore.ask(
@ctx,
[],
title: @ctx.message("theme.confirm_current_directory"),
force: options.flags[:force],
force: !ShopifyCLI::Environment.interactive?,
).confirmed?
end

Expand Down
6 changes: 6 additions & 0 deletions lib/project_types/theme/commands/pull.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,18 @@ class Pull < ShopifyCLI::Command::SubCommand
flags[:ignores] |= pattern
end
parser.on("-f", "--force") { flags[:force] = true }
parser.on("--development-theme-id=DEVELOPMENT_THEME_ID") do |development_theme_id|
flags[:development_theme_id] = development_theme_id.to_i
end
end

def call(_args, name)
root = root_value(options, name)
return if exist_and_not_empty?(root) && !valid_theme_directory?(root)

development_theme_id = options.flags[:development_theme_id]
ShopifyCLI::DB.set(development_theme_id: development_theme_id) unless development_theme_id.nil?

delete = !options.flags[:nodelete]
theme = find_theme(root, **options.flags)
return if theme.nil?
Expand Down
6 changes: 6 additions & 0 deletions lib/project_types/theme/commands/push.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,18 @@ class Push < ShopifyCLI::Command::SubCommand
flags[:ignores] |= pattern
end
parser.on("-f", "--force") { flags[:force] = true }
parser.on("--development-theme-id=DEVELOPMENT_THEME_ID") do |development_theme_id|
flags[:development_theme_id] = development_theme_id.to_i
end
end

def call(_args, name)
root = root_value(options, name)
return unless valid_theme_directory?(root)

development_theme_id = options.flags[:development_theme_id]
ShopifyCLI::DB.set(development_theme_id: development_theme_id) unless development_theme_id.nil?

delete = !options.flags[:nodelete]
theme = find_theme(root, **options.flags)
return if theme.nil?
Expand Down
6 changes: 4 additions & 2 deletions lib/project_types/theme/messages/messages.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

module Theme
module Messages
MESSAGES = {
Expand All @@ -18,8 +19,9 @@ module Messages
ENSURE_USER
stable_flag_suggestion: "If the current command isn't working as expected," \
" we suggest re-running the command with the {{command: --stable}} flag",
confirm_current_directory: "It doesn’t seem like you’re running this command in a theme directory. " \
"Are you sure you want to proceed?",
current_directory_is_not_theme_directory: "It doesn’t seem like you’re running this command" \
" in a theme directory.",
confirm_current_directory: "Are you sure you want to proceed?",
init: {
help: <<~HELP,
{{command:%s theme init}}: Clones a Git repository to use as a starting point for building a new theme.
Expand Down