Sha256: f870657b7f14a663fdb9dc0ebcd722b00b3066a7d974b51bdd473a49c7b06952

Contents?: true

Size: 1.31 KB

Versions: 221

Compression:

Stored size: 1.31 KB

Contents

# frozen_string_literal: true

require 'avm/tools/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

221 entries across 221 versions & 2 rubygems

Version Path
avm-tools-0.160.2 lib/avm/tools/runner/git/subrepo/check.rb
eac_tools-0.86.4 sub/avm-tools/lib/avm/tools/runner/git/subrepo/check.rb
eac_tools-0.86.3 sub/avm-tools/lib/avm/tools/runner/git/subrepo/check.rb
avm-tools-0.160.1 lib/avm/tools/runner/git/subrepo/check.rb
eac_tools-0.86.2 sub/avm-tools/lib/avm/tools/runner/git/subrepo/check.rb
eac_tools-0.86.1 sub/avm-tools/lib/avm/tools/runner/git/subrepo/check.rb
avm-tools-0.160.0 lib/avm/tools/runner/git/subrepo/check.rb
eac_tools-0.86.0 sub/avm-tools/lib/avm/tools/runner/git/subrepo/check.rb
eac_tools-0.85.1 sub/avm-tools/lib/avm/tools/runner/git/subrepo/check.rb
avm-tools-0.159.1 lib/avm/tools/runner/git/subrepo/check.rb
eac_tools-0.85.0 sub/avm-tools/lib/avm/tools/runner/git/subrepo/check.rb
eac_tools-0.84.2 sub/avm-tools/lib/avm/tools/runner/git/subrepo/check.rb
eac_tools-0.84.1 sub/avm-tools/lib/avm/tools/runner/git/subrepo/check.rb
eac_tools-0.84.0 sub/avm-tools/lib/avm/tools/runner/git/subrepo/check.rb
eac_tools-0.83.0 sub/avm-tools/lib/avm/tools/runner/git/subrepo/check.rb
avm-tools-0.159.0 lib/avm/tools/runner/git/subrepo/check.rb
eac_tools-0.82.0 sub/avm-tools/lib/avm/tools/runner/git/subrepo/check.rb
avm-tools-0.158.0 lib/avm/tools/runner/git/subrepo/check.rb
eac_tools-0.81.0 sub/avm-tools/lib/avm/tools/runner/git/subrepo/check.rb
eac_tools-0.80.0 sub/avm-tools/lib/avm/tools/runner/git/subrepo/check.rb