Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix rvm install #84

Merged
merged 4 commits into from
Apr 14, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
default['rvm']['user_installs'] = []

# system-wide installer options
default['rvm']['installer_url'] = "https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer"
default['rvm']['installer_url'] = "https://get.rvm.io"
default['rvm']['branch'] = "stable"
default['rvm']['version'] = "head"
default['rvm']['upgrade'] = "none"
Expand Down
10 changes: 4 additions & 6 deletions libraries/chef_rvm_recipe_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ module RVM
module RecipeHelpers
def build_script_flags(version, branch)
script_flags = ""
script_flags += " -s --" if version or branch
script_flags += " --version #{version}" if version
script_flags += " --branch #{branch}" if branch
script_flags
Expand Down Expand Up @@ -59,19 +60,16 @@ def install_rvm(opts = {})
if opts[:user]
user_dir = opts[:rvm_prefix]
exec_name = "install user RVM for #{opts[:user]}"
exec_env = { 'USER' => opts[:user], 'HOME' => user_dir }
exec_env = { 'USER' => opts[:user], 'HOME' => user_dir, 'TERM' => 'dumb' }
else
user_dir = nil
exec_name = "install system-wide RVM"
exec_env = nil
exec_env = { 'TERM' => 'dumb' }
end

i = execute exec_name do
user opts[:user] || "root"
command <<-CODE
bash -c "bash \
<( curl -Ls #{opts[:installer_url]} )#{opts[:script_flags]}"
CODE
command "curl -L #{opts[:installer_url]} | bash #{opts[:script_flags]}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can just specify bash here and not have to include line 71, interpreter 'bash'

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, bash instead of script and interpreter. You're totally right. I'll update it, thanks.

environment(exec_env)

# excute in compile phase if gem_package recipe is requested
Expand Down