From a2cdbf26da08f3e0aea68eacfbc2244730eb4eb7 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 18 Jun 2014 15:51:08 -0400 Subject: [PATCH] Replace sh() with sh_safe() --- rake/lib/rbenv.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/rake/lib/rbenv.rb b/rake/lib/rbenv.rb index 1180108a..d643b1a6 100644 --- a/rake/lib/rbenv.rb +++ b/rake/lib/rbenv.rb @@ -8,27 +8,27 @@ module Rbenv def self.bootstrap unless self.is_installed? BREWS.each { |pkg| Homebrew.install pkg } - sh 'exec $SHELL -l' + sh_safe 'exec $SHELL -l' end end def self.destroy if self.is_installed? BREWS.each { |pkg| Homebrew.remove pkg } - # sh "rm -rf #{Homebrew.prefix 'rbenv'}" + # sh_safe "rm -rf #{Homebrew.prefix 'rbenv'}" end end def self.install(version, gems=[]) unless self.is_version_installed?(version) - sh "rbenv install #{version}" + sh_safe "rbenv install #{version}" end - sh "RBENV_VERSION=#{version} gem install #{gems.join(' ')}" + sh_safe "RBENV_VERSION=#{version} gem install #{gems.join(' ')}" end def self.update(version) - sh "RBENV_VERSION=#{version} gem update" - sh "RBENV_VERSION=#{version} gem clean" + sh_safe "RBENV_VERSION=#{version} gem update" + sh_safe "RBENV_VERSION=#{version} gem clean" end def self.is_installed? @@ -36,7 +36,7 @@ module Rbenv end def self.is_version_installed?(version) - system("rbenv versions | grep -w #{version}") + system("rbenv versions | grep -w #{version} &>/dev/null") end def self.installed_versions