Method: Puppet::ModuleTool::LocalTarball#install

Defined in:
lib/puppet/module_tool/local_tarball.rb

#install(release, dir) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



33
34
35
36
37
38
39
40
41
42
43
# File 'lib/puppet/module_tool/local_tarball.rb', line 33

def install(release, dir)
  staging_dir = release.prepare

  module_dir = dir + release.name[/-(.*)/, 1]
  module_dir.rmtree if module_dir.exist?

  # Make sure unpacked module has the same ownership as the folder we are moving it into.
  Puppet::ModuleTool::Applications::Unpacker.harmonize_ownership(dir, staging_dir)

  FileUtils.mv(staging_dir, module_dir)
end