18
19
20
21
22
23
24
25
26
27
|
# File 'lib/niman/installer.rb', line 18
def install_package(package)
package_manager = managers.fetch(shell.os.to_sym) { raise Niman::InstallError, shell.os }
return unless package.installable?
if package.respond_to?(:package_names)
package_name = package.package_names.fetch(shell.os.to_sym) { raise Niman::InstallError, "Package has no support for #{shell.os}" }
shell.exec("#{package_manager} install #{package_name}", true)
elsif package.respond_to?(:name)
shell.exec("#{package_manager} install #{package.name}", true)
end
end
|