Class: Librarian::Puppet::Source::Git

Inherits:
Source::Git show all
Includes:
Local, Util
Defined in:
lib/librarian/puppet/source/git.rb

Instance Method Summary collapse

Methods included from Util

#clean_uri, #cp_r, #debug, #info, #module_name, #normalize_name, #rsync?, #warn

Methods included from Local

#fetch_dependencies, #fetch_version, #forge_source, #install!

Instance Method Details

#cache!Object



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/librarian/puppet/source/git.rb', line 27

def cache!
  return vendor_checkout! if vendor_cached?

  if environment.local?
    raise Error, "Could not find a local copy of #{uri}#{" at #{sha}" unless sha.nil?}."
  end

  begin
    super
  rescue Librarian::Posix::CommandFailure => e
    raise Error, "Could not checkout #{uri}#{" at #{sha}" unless sha.nil?}: #{e}"
  end

  cache_in_vendor(repository.path) if environment.vendor?
end