Skip to content

Commit

Permalink
[COOK-4512] Bugfix: Use empty PATH if PATH is nil
Browse files Browse the repository at this point in the history
Signed-off-by: Sean OMeara <[email protected]>
  • Loading branch information
Florian Holzhauer authored and Sean OMeara committed Apr 24, 2014
1 parent f21690e commit aaa295e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions libraries/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def apt_installed?
#
# @return [String, nil]
def which(cmd)
ENV["PATH"] = "" if ENV["PATH"].nil?
paths = (ENV['PATH'].split(::File::PATH_SEPARATOR) + %w(/bin /usr/bin /sbin /usr/sbin))

paths.each do |path|
Expand Down

1 comment on commit aaa295e

@mlafeldt
Copy link

Choose a reason for hiding this comment

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

@fh

ENV["PATH"] ||= ""

;-)

Please sign in to comment.