6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
# File 'lib/librarian/puppet/source/local.rb', line 6
def install!(manifest)
manifest.source == self or raise ArgumentError
debug { "Installing #{manifest}" }
name, version = manifest.name, manifest.version
found_path = found_path(name)
raise Error, "Path for #{name} doesn't contain a puppet module" if found_path.nil?
if name.include? '/'
new_name = name.split('/').last
debug { "Invalid module name '#{name}', guessing you meant '#{new_name}'" }
name = new_name
end
install_path = environment.install_path.join(name)
if install_path.exist?
debug { "Deleting #{relative_path_to(install_path)}" }
install_path.rmtree
end
install_perform_step_copy!(found_path, install_path)
end
|