diff options
Diffstat (limited to 'Rakefile')
-rw-r--r-- | Rakefile | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -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" |