Module: Avm::Git::Launcher::Base::Subrepo

Included in:
Avm::Git::Launcher::Base
Defined in:
lib/avm/git/launcher/base/subrepo.rb

Instance Method Summary collapse

Instance Method Details

#subrepo_remote_url(subrepo_path) ⇒ Object



20
21
22
23
24
25
26
# File 'lib/avm/git/launcher/base/subrepo.rb', line 20

def subrepo_remote_url(subrepo_path)
  h = subrepo_status(subrepo_path)
  url = h['Remote URL']
  return url if url.present?

  raise "Remote URL is blank for subrepo \"#{subrepo_path}\" (Subrepo status: #{h})"
end

#subrepo_status(subrepo_path) ⇒ Object



10
11
12
13
14
15
16
17
18
# File 'lib/avm/git/launcher/base/subrepo.rb', line 10

def subrepo_status(subrepo_path)
  s = execute!('subrepo', 'status', subrepo_path.gsub(%r{\A/}, ''))
  raise s.strip.to_s if s.include?('is not a subrepo')

  r = subrepo_status_parse_output(s)
  raise "Empty subrepo status for |#{s}|\n" unless r.any?

  r
end