Sha256: 6e457459d1f7478f3d12416ce0cc16c1c6d0a99f01b0500cd04eeffcd8ddaa43

Contents?: true

Size: 800 Bytes

Versions: 40

Compression:

Stored size: 800 Bytes

Contents

# frozen_string_literal: true

module Extension
  module Features
    class ArgoSetupStep
      include SmartProperties

      property! :step
      property! :can_fail, accepts: [true, false], reader: :can_fail?

      def call(context, identifier, directory_name, js_system)
        step_result = step.call(context, identifier, directory_name, js_system)
        can_fail? ? step_result : true
      rescue ShopifyCli::Abort => e
        context.puts(e.message)
        false
      rescue StandardError => e
        context.puts("{{x}} #{e.message}")
        false
      end

      def self.default(&block)
        ArgoSetupStep.new(step: block, can_fail: true)
      end

      def self.always_successful(&block)
        ArgoSetupStep.new(step: block, can_fail: false)
      end
    end
  end
end

Version data entries

40 entries across 40 versions & 1 rubygems

Version Path
shopify-cli-2.4.0 lib/project_types/extension/features/argo_setup_step.rb
shopify-cli-2.3.0 lib/project_types/extension/features/argo_setup_step.rb
shopify-cli-2.2.2 lib/project_types/extension/features/argo_setup_step.rb
shopify-cli-2.2.1 lib/project_types/extension/features/argo_setup_step.rb
shopify-cli-2.2.0 lib/project_types/extension/features/argo_setup_step.rb
shopify-cli-2.1.0 lib/project_types/extension/features/argo_setup_step.rb
shopify-cli-2.0.2 lib/project_types/extension/features/argo_setup_step.rb
shopify-cli-2.0.1 lib/project_types/extension/features/argo_setup_step.rb
shopify-cli-2.0.0 lib/project_types/extension/features/argo_setup_step.rb
shopify-cli-1.14.0 lib/project_types/extension/features/argo_setup_step.rb
shopify-cli-1.13.1 lib/project_types/extension/features/argo_setup_step.rb
shopify-cli-1.13.0 lib/project_types/extension/features/argo_setup_step.rb
shopify-cli-1.12.0 lib/project_types/extension/features/argo_setup_step.rb
shopify-cli-1.11.0 lib/project_types/extension/features/argo_setup_step.rb
shopify-cli-1.10.0 lib/project_types/extension/features/argo_setup_step.rb
shopify-cli-1.9.1 lib/project_types/extension/features/argo_setup_step.rb
shopify-cli-1.9.0 lib/project_types/extension/features/argo_setup_step.rb
shopify-cli-1.8.0 lib/project_types/extension/features/argo_setup_step.rb
shopify-cli-1.7.1 lib/project_types/extension/features/argo_setup_step.rb
shopify-cli-1.7.0 lib/project_types/extension/features/argo_setup_step.rb