diff options
author | Paul Nasrat <pnasrat@googlemail.com> | 2008-07-17 18:00:51 +0100 |
---|---|---|
committer | Paul Nasrat <pnasrat@googlemail.com> | 2008-07-17 18:00:51 +0100 |
commit | 1eb94d31cc9fa1c2ae36e1000fe91515d95cb935 (patch) | |
tree | 6c3a1fa36fe562dc4a46562bf02840b1c8273b1f | |
parent | bb235e349774d29e1a1a8766125f241ddb598f68 (diff) | |
download | facter-1eb94d31cc9fa1c2ae36e1000fe91515d95cb935.tar.gz facter-1eb94d31cc9fa1c2ae36e1000fe91515d95cb935.tar.xz facter-1eb94d31cc9fa1c2ae36e1000fe91515d95cb935.zip |
Bug #1434 Don't execute which on windows
-rw-r--r-- | lib/facter/util/resolution.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/facter/util/resolution.rb b/lib/facter/util/resolution.rb index cc8c842..4d0a8d1 100644 --- a/lib/facter/util/resolution.rb +++ b/lib/facter/util/resolution.rb @@ -6,14 +6,19 @@ require 'facter/util/confine' require 'timeout' +require 'rbconfig' class Facter::Util::Resolution attr_accessor :interpreter, :code, :name, :timeout def self.have_which if ! defined?(@have_which) or @have_which.nil? - %x{which which 2>/dev/null} - @have_which = ($? == 0) + if Config::CONFIG['host_os'] =~ /mswin/ + @have_which = false + else + %x{which which 2>/dev/null} + @have_which = ($? == 0) + end end @have_which end |