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-1.6.0 lib/project_types/extension/features/argo_setup_step.rb
shopify-cli-1.5.0 lib/project_types/extension/features/argo_setup_step.rb
shopify-cli-1.4.1 lib/project_types/extension/features/argo_setup_step.rb
shopify-cli-1.4.0 lib/project_types/extension/features/argo_setup_step.rb
shopify-cli-1.3.1 lib/project_types/extension/features/argo_setup_step.rb
shopify-cli-1.3.0 lib/project_types/extension/features/argo_setup_step.rb
shopify-cli-1.2.0 lib/project_types/extension/features/argo_setup_step.rb
shopify-cli-1.1.2 lib/project_types/extension/features/argo_setup_step.rb
shopify-cli-1.1.1 lib/project_types/extension/features/argo_setup_step.rb
shopify-cli-1.1.0 lib/project_types/extension/features/argo_setup_step.rb
shopify-cli-1.0.5 lib/project_types/extension/features/argo_setup_step.rb
shopify-cli-1.0.4 lib/project_types/extension/features/argo_setup_step.rb
shopify-cli-1.0.3 lib/project_types/extension/features/argo_setup_step.rb
shopify-cli-1.0.2 lib/project_types/extension/features/argo_setup_step.rb
shopify-cli-1.0.1 lib/project_types/extension/features/argo_setup_step.rb
shopify-cli-1.0.0 lib/project_types/extension/features/argo_setup_step.rb
shopify-cli-0.9.3 lib/project_types/extension/features/argo_setup_step.rb
shopify-cli-0.9.2 lib/project_types/extension/features/argo_setup_step.rb
shopify-cli-0.9.1 lib/project_types/extension/features/argo_setup_step.rb
shopify-cli-0.9.0 lib/project_types/extension/features/argo_setup_step.rb