From aaa295e3b9634e442e7ec6b14ae3adf577c8806f Mon Sep 17 00:00:00 2001 From: Florian Holzhauer Date: Wed, 23 Apr 2014 21:48:08 -0700 Subject: [PATCH] [COOK-4512] Bugfix: Use empty PATH if PATH is nil Signed-off-by: Sean OMeara --- libraries/helpers.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/libraries/helpers.rb b/libraries/helpers.rb index 6fe95a97..a7f9655c 100644 --- a/libraries/helpers.rb +++ b/libraries/helpers.rb @@ -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|