From 1eb94d31cc9fa1c2ae36e1000fe91515d95cb935 Mon Sep 17 00:00:00 2001 From: Paul Nasrat Date: Thu, 17 Jul 2008 18:00:51 +0100 Subject: Bug #1434 Don't execute which on windows --- lib/facter/util/resolution.rb | 9 +++++++-- 1 file 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 -- cgit