From bd6dc3c8eadb23713a4d50ef6284a08563b25a60 Mon Sep 17 00:00:00 2001 From: mwrock Date: Tue, 17 Nov 2020 13:08:59 -0800 Subject: update pwsh in powershell_exec to 7.1.0 and add comments explaining how to pull in updates Signed-off-by: mwrock --- Rakefile | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'Rakefile') diff --git a/Rakefile b/Rakefile index 93ec6b647f..09c8d5e131 100644 --- a/Rakefile +++ b/Rakefile @@ -88,6 +88,25 @@ task :register_eventlog do end end +desc "Copies powershell_exec related binaries from the latest built Habitat Packages" +task :update_chef_exec_dll do + raise "This task must be run on Windows since we are installing a Windows targeted package!" unless Gem.win_platform? + + require "mkmf" + raise "Unable to locate Habitat cli. Please install Habitat cli before invoking this task!" unless find_executable "hab" + + sh("hab pkg install chef/chef-powershell-shim") + sh("hab pkg install chef/chef-powershell-shim-x86") + x64 = `hab pkg path chef/chef-powershell-shim`.chomp.gsub(/\\/, "/") + x86 = `hab pkg path chef/chef-powershell-shim-x86`.chomp.gsub(/\\/, "/") + FileUtils.rm_rf(Dir["distro/ruby_bin_folder/AMD64/*"]) + FileUtils.rm_rf(Dir["distro/ruby_bin_folder/x86/*"]) + puts "Copying #{x64}/bin/* to distro/ruby_bin_folder/AMD64" + FileUtils.cp_r(Dir["#{x64}/bin/*"], "distro/ruby_bin_folder/AMD64") + puts "Copying #{x86}/bin/* to distro/ruby_bin_folder/x86" + FileUtils.cp_r(Dir["#{x86}/bin/*"], "distro/ruby_bin_folder/x86") +end + begin require "chefstyle" require "rubocop/rake_task" -- cgit v1.2.1