Sha256: a4fa58505692c3a18143a939861370f9e24adb9b6e9333b4cc1d0295457843e4

Contents?: true

Size: 1.31 KB

Versions: 9

Compression:

Stored size: 1.31 KB

Contents

# frozen_string_literal: true

require 'avm/core_ext'
require 'eac_git/local'

module Avm
  module Tools
    class Runner
      class Git
        class Subrepo
          class Check
            runner_with :help do
              desc 'Check status of subrepos.'
              bool_opt '-a', '--all', 'Select all subrepos.'
              bool_opt '-f', '--fix-parent', 'Fix parent SHA1.'
              bool_opt '-n', '--no-error', 'Do not exit with error if check fails.'
              bool_opt '-r', '--remote', 'Check subrepos remote.'
              pos_arg :subrepos, repeat: true, optional: true
            end

            def run
              subrepo_checks.show_result
              return if parsed.no_error?
              return unless subrepo_checks.result.error?

              fatal_error 'Failed'
            end

            private

            def subrepo_checks_uncached
              r = ::Avm::Git::SubrepoChecks.new(local_repos)
              r.check_remote = parsed.remote?
              r.fix_parent = parsed.fix_parent?
              r.add_all_subrepos if parsed.all?
              r.add_subrepos(*parsed.subrepos)
              r
            end

            def local_repos_uncached
              ::EacGit::Local.new(runner_context.call(:git))
            end
          end
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
avm-tools-0.103.0 lib/avm/tools/runner/git/subrepo/check.rb
avm-tools-0.102.2 lib/avm/tools/runner/git/subrepo/check.rb
avm-tools-0.102.1 lib/avm/tools/runner/git/subrepo/check.rb
avm-tools-0.102.0 lib/avm/tools/runner/git/subrepo/check.rb
avm-tools-0.101.0 lib/avm/tools/runner/git/subrepo/check.rb
avm-tools-0.100.0 lib/avm/tools/runner/git/subrepo/check.rb
avm-tools-0.99.1 lib/avm/tools/runner/git/subrepo/check.rb
avm-tools-0.99.0 lib/avm/tools/runner/git/subrepo/check.rb
avm-tools-0.98.0 lib/avm/tools/runner/git/subrepo/check.rb