Skip to content
This repository was archived by the owner on Jun 1, 2023. It is now read-only.
Closed
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ From version 2.6.0, the sections in this file adhere to the [keep a changelog](h
### Fixed
* [#2721](https://github.com/Shopify/shopify-cli/pull/2721): Do not `replace_asset_urls` in font bodies
* [#2729](https://github.com/Shopify/shopify-cli/pull/2729): Do not inject hot-reload code into web-pixels-manager sandbox (from cli#1370)
* [#2730](https://github.com/Shopify/shopify-cli/pull/2730): Remove "Current theme directory can't be confirmed during tests" check

### Added
* [#2724](https://github.com/Shopify/shopify-cli/pull/2724): Introduce hidden `--overwrite-json` flag
Expand Down
6 changes: 4 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,12 +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?
message = @ctx.message("theme.current_directory_is_not_theme_directory")
@ctx.abort(message) unless ShopifyCLI::Environment.interactive?

message += " \n#{@ctx.message("theme.confirm_current_directory")}"
Forms::ConfirmStore.ask(
@ctx,
[],
title: @ctx.message("theme.confirm_current_directory"),
title: message,
force: options.flags[:force],
).confirmed?
end
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