Permalink
Browse files

rescue failed shell-outs to `which`

closes #664
  • Loading branch information...
1 parent 9db9102 commit 32e3cdf367d19d9207c388ce3a3f045d78242d28 @indirect indirect committed Nov 12, 2010
Showing with 2 additions and 3 deletions.
  1. +1 −2 lib/bundler/cli.rb
  2. +1 −1 spec/support/sudo.rb
View
@@ -500,8 +500,7 @@ def self.source_root
private
def have_groff?
- `which groff 2>#{NULL}`
- $? == 0
+ system("which groff 2>#{NULL}") rescue false
end
def locate_gem(name)
View
@@ -1,7 +1,7 @@
module Spec
module Sudo
def self.present?
- @which_sudo ||= `which sudo`.strip
+ @which_sudo ||= `which sudo`.strip rescue ''
!@which_sudo.empty? && ENV['BUNDLER_SUDO_TESTS']
end

0 comments on commit 32e3cdf

Please sign in to comment.