Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

reconfigures nodejs recipe so that chef doesn't try to install it if …

…it is already installed
  • Loading branch information...
commit d046f87ec164ac41828603eff9e21a141f24331c 1 parent 5e0b0a1
@semmypurewal authored
Showing with 8 additions and 1 deletion.
  1. +8 −1 cookbooks/nodejs/recipes/default.rb
View
9 cookbooks/nodejs/recipes/default.rb
@@ -43,6 +43,7 @@
make && \
make install
EOH
+ not_if "#{node[:nodejs][:dir]}/bin/node -v 2>&1 | grep 'v#{node[:nodejs][:version]}'"
end
if node[:nodejs][:version] < "0.6.3"
@@ -55,10 +56,13 @@
code <<-EOH
curl https://npmjs.org/install.sh | clean=no sh
EOH
+ not_if "#{node[:nodejs][:dir]}/bin/npm -v 2>&1 | grep '#{node[:nodejs][:npm]}'"
end
end
+
else
- bash "install nodejs" do
+
+ bash "install nodejs binary" do
cwd "/opt"
user "root"
code <<-EOH
@@ -68,5 +72,8 @@
ln -s /opt/node-v#{node[:nodejs][:version]}-linux-x86/bin/node-waf /usr/local/bin/node-waf && \
ln -s /opt/node-v#{node[:nodejs][:version]}-linux-x86/bin/npm /usr/local/bin/npm
EOH
+ not_if "/opt/node-v#{node[:nodejs][:version]}-linux-x86/bin/node -v | grep 'v#{node[:nodejs][:version]}'"
end
+
+
end
Please sign in to comment.
Something went wrong with that request. Please try again.