File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -210,7 +210,8 @@ def omnibus_env
210210 end
211211
212212 def get_pkg_prefix ( pkg_name )
213- path = `hab pkg path #{ pkg_name } 2>/dev/null` . strip
213+ stderr_redirect = Chef ::Platform . windows? ? "2>NUL" : "2>/dev/null"
214+ path = `hab pkg path #{ pkg_name } #{ stderr_redirect } ` . strip
214215 path if !path . empty? && Dir . exist? ( path ) # Return path only if it exists
215216 end
216217
@@ -265,7 +266,8 @@ def macos?
265266 # @api private
266267 #
267268 def hab_pkg_installed? ( pkg_name )
268- `hab pkg list #{ pkg_name } 2>/dev/null` . include? ( pkg_name ) rescue false
269+ stderr_redirect = Chef ::Platform . windows? ? "2>NUL" : "2>/dev/null"
270+ `hab pkg list #{ pkg_name } #{ stderr_redirect } ` . include? ( pkg_name ) rescue false
269271 end
270272 end
271273end
You can’t perform that action at this time.
0 commit comments