Sha256: 2f8f3f948f85b0b1c56c0be6f84d35a4de7e329ac495fd1bcaf55c691b3144c0

Contents?: true

Size: 765 Bytes

Versions: 9

Compression:

Stored size: 765 Bytes

Contents

# frozen_string_literal: true

module ShopifyCLI
  module Theme
    module IgnoreHelper
      def ignore_operation?(operation)
        path = operation.file_path
        ignore_path?(path)
      end

      def ignore_file?(file)
        path = file.relative_path
        ignore_path?(path)
      end

      def ignore_path?(path)
        is_ignored = ignored_by_ignore_filter?(path) || ignored_by_include_filter?(path)

        if is_ignored && @ctx
          @ctx.debug("ignore #{path}")
        end

        is_ignored
      end

      private

      def ignored_by_ignore_filter?(path)
        ignore_filter&.ignore?(path)
      end

      def ignored_by_include_filter?(path)
        !!include_filter && !include_filter.match?(path)
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
shopify-cli-2.36.0 lib/shopify_cli/theme/ignore_helper.rb
shopify-cli-2.35.0 lib/shopify_cli/theme/ignore_helper.rb
shopify-cli-2.34.0 lib/shopify_cli/theme/ignore_helper.rb
shopify-cli-2.33.1 lib/shopify_cli/theme/ignore_helper.rb
shopify-cli-2.33.0 lib/shopify_cli/theme/ignore_helper.rb
shopify-cli-2.32.1 lib/shopify_cli/theme/ignore_helper.rb
shopify-cli-2.32.0 lib/shopify_cli/theme/ignore_helper.rb
shopify-cli-2.31.0 lib/shopify_cli/theme/ignore_helper.rb
shopify-cli-2.30.0 lib/shopify_cli/theme/ignore_helper.rb