Skip to content

Instantly share code, notes, and snippets.

@kenji0x02
Last active October 25, 2015 13:26
Show Gist options
  • Save kenji0x02/8787990 to your computer and use it in GitHub Desktop.
Save kenji0x02/8787990 to your computer and use it in GitHub Desktop.
git "/usr/local/nvm" do
repository "git://github.com/creationix/nvm.git"
reference "master"
action :sync
end
template "/etc/profile.d/nvm.sh" do
source "nvm.sh.erb"
mode 00644
end
# nvm listしたときにalias/ディレクトリがないとおこられるので、、
directory '/usr/local/nvm/alias' do
action :create
end
bash "install nodejs" do
code <<-EOC
source /usr/local/nvm/nvm.sh
nvm install #{node['nodejs']['version']}
EOC
# ここにnodeの本体がいる
creates "/usr/local/nvm/#{node['nodejs']['version']}"
end
source /usr/local/nvm/nvm.sh
nvm use <%= node['nodejs']['version'] %> >/dev/null 2>&1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment