Sha256: 5b096cef19a4948740d4f679016f5c27aed8d815ed7230a2c807db73069a4000

Contents?: true

Size: 1.28 KB

Versions: 2

Compression:

Stored size: 1.28 KB

Contents

# frozen_string_literal: true

module Script
  module Layers
    module Application
      class PushScript
        class << self
          def call(ctx:, force:)
            script_project = ScriptProject.current
            task_runner = Infrastructure::TaskRunner.for(ctx, script_project.language, script_project.script_name)
            config_ui = Infrastructure::ConfigUiRepository.new(ctx: ctx).get_config_ui(script_project.config_ui_file)

            ProjectDependencies.install(ctx: ctx, task_runner: task_runner)
            BuildScript.call(ctx: ctx, task_runner: task_runner, script_project: script_project, config_ui: config_ui)

            UI::PrintingSpinner.spin(ctx, ctx.message("script.application.pushing")) do |p_ctx, spinner|
              package = Infrastructure::PushPackageRepository.new(ctx: p_ctx).get_push_package(
                script_project: script_project,
                compiled_type: task_runner.compiled_type,
                metadata: task_runner.metadata,
                config_ui: config_ui,
              )
              package.push(Infrastructure::ScriptService.new(ctx: p_ctx), script_project.api_key, force)
              spinner.update_title(p_ctx.message("script.application.pushed"))
            end
          end
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
shopify-cli-1.8.0 lib/project_types/script/layers/application/push_script.rb
shopify-cli-1.7.1 lib/project_types/script/layers/application/push_script.rb