Sha256: 31bfcda9e4937bd9db202358b8e40e0c308f14d76d3b0f85cfccabcd7fd762de

Contents?: true

Size: 752 Bytes

Versions: 22

Compression:

Stored size: 752 Bytes

Contents

# frozen_string_literal: true

require "shopify_cli/theme/theme"
require "project_types/theme/presenters/themes_presenter"

module Theme
  class Command
    class List < ShopifyCLI::Command::SubCommand
      recommend_default_ruby_range

      def call(_args, _name)
        @ctx.puts(@ctx.message("theme.list.title", shop))

        themes_presenter.all.each do |theme|
          @ctx.puts("  #{theme}")
        end
      end

      def self.help
        @ctx.message("theme.list.help", ShopifyCLI::TOOL_NAME, ShopifyCLI::TOOL_NAME)
      end

      private

      def themes_presenter
        Theme::Presenters::ThemesPresenter.new(@ctx, nil)
      end

      def shop
        ShopifyCLI::AdminAPI.get_shop_or_abort(@ctx)
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
shopify-cli-2.25.0 lib/project_types/theme/commands/list.rb
shopify-cli-2.24.0 lib/project_types/theme/commands/list.rb
shopify-cli-2.23.0 lib/project_types/theme/commands/list.rb
shopify-cli-2.22.0 lib/project_types/theme/commands/list.rb
shopify-cli-2.21.0 lib/project_types/theme/commands/list.rb
shopify-cli-2.20.1 lib/project_types/theme/commands/list.rb
shopify-cli-2.20.0 lib/project_types/theme/commands/list.rb
shopify-cli-2.19.0 lib/project_types/theme/commands/list.rb
shopify-cli-2.18.1 lib/project_types/theme/commands/list.rb
shopify-cli-2.18.0 lib/project_types/theme/commands/list.rb
shopify-cli-2.17.0 lib/project_types/theme/commands/list.rb
shopify-cli-2.16.1 lib/project_types/theme/commands/list.rb
shopify-cli-2.16.0 lib/project_types/theme/commands/list.rb
shopify-cli-2.15.6 lib/project_types/theme/commands/list.rb
shopify-cli-2.15.5 lib/project_types/theme/commands/list.rb
shopify-cli-2.15.4 lib/project_types/theme/commands/list.rb
shopify-cli-2.15.3 lib/project_types/theme/commands/list.rb
shopify-cli-2.15.2 lib/project_types/theme/commands/list.rb
shopify-cli-2.15.1 lib/project_types/theme/commands/list.rb
shopify-cli-2.15.0 lib/project_types/theme/commands/list.rb