Replace sh() with sh_safe()
This commit is contained in:
parent
31f535f2a6
commit
a2cdbf26da
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue