summaryrefslogtreecommitdiff
path: root/lib/chef/provider/batch.rb
diff options
context:
space:
mode:
authorSalim Alam <salam@chef.io>2015-08-13 14:25:48 -0700
committerSalim Alam <salam@chef.io>2015-08-19 11:08:17 -0700
commit6c4cd5c6d5c40baca723bf95cdbccdda59021198 (patch)
treef2d6357705440c11467b46c60eac0b4c5ddb871e /lib/chef/provider/batch.rb
parentfe6676bab51390429674b0ecd4670924ffb09cc5 (diff)
downloadchef-6c4cd5c6d5c40baca723bf95cdbccdda59021198.tar.gz
Enable 64-bit support for Powershell and Batch scripts
Diffstat (limited to 'lib/chef/provider/batch.rb')
-rw-r--r--lib/chef/provider/batch.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/chef/provider/batch.rb b/lib/chef/provider/batch.rb
index b6b386e5a8..5f0134443d 100644
--- a/lib/chef/provider/batch.rb
+++ b/lib/chef/provider/batch.rb
@@ -28,6 +28,14 @@ class Chef
super(new_resource, run_context, '.bat')
end
+ def command
+ basepath = is_forced_32bit ? wow64_directory : run_context.node.kernel.os_info.system_directory
+
+ interpreter_path = Chef::Util::PathHelper.join(basepath, interpreter)
+
+ "\"#{interpreter_path}\" #{flags} \"#{script_file.path}\""
+ end
+
def flags
@new_resource.flags.nil? ? '/c' : new_resource.flags + ' /c'
end