chef/cookbooks/nodejs/recipes/npm_packages.rb
Greg Karékinian edf2e071e4 Upgrade nodejs to the latest version from the repo
This is possible in newer versions of the nodejs cookbook, by setting
the `node["nodejs"]["package_action"]["nodejs"]` attribute to `:upgrade`
2021-03-30 13:58:55 +02:00

14 lines
407 B
Ruby

if node['nodejs'].key?('npm_packages')
node['nodejs']['npm_packages'].each do |pkg|
pkg_action = pkg.key?('action') ? pkg['action'] : :install
f = npm_package "nodejs_npm-#{pkg['name']}-#{pkg_action}" do
action :nothing
package pkg['name']
end
pkg.each do |key, value|
f.send(key, value) unless key == 'name' || key == 'action'
end
f.action(pkg_action)
end
end