diff options
author | Marc Chamberland <chamberland.marc@gmail.com> | 2020-02-24 14:19:03 -0500 |
---|---|---|
committer | Marc Chamberland <chamberland.marc@gmail.com> | 2020-02-24 14:19:03 -0500 |
commit | ba1f7c0d3afb0b82185c60f4367dd8b0936ebc42 (patch) | |
tree | ebc4a9991a65d17b47dd60229d8407e71238b78d /Rakefile | |
parent | 8a0ef12a66480e520c0ea7ea97e30ef13f0bef49 (diff) | |
download | chef-ba1f7c0d3afb0b82185c60f4367dd8b0936ebc42.tar.gz |
Templating powershell extensions to inject distro constants
Signed-off-by: Marc Chamberland <chamberland.marc@gmail.com>
Diffstat (limited to 'Rakefile')
-rw-r--r-- | Rakefile | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -22,6 +22,7 @@ begin require_relative "tasks/dependencies" require_relative "tasks/announce" require_relative "tasks/docs" + require_relative "lib/chef/dist" rescue LoadError => e puts "Skipping missing rake dep: #{e}" end @@ -35,6 +36,14 @@ task :super_install do Dir.chdir(path) sh("rake install") end + +# Templating the powershell extensions so we can inject distro constants + template_file = ::File.join(::File.dirname(__FILE__), "distro", "templates", "powershell", "chef", "chef.psm1.erb") + psm1_path = ::File.join(::File.dirname(__FILE__), "distro", "powershell", "chef") + FileUtils.mkdir_p psm1_path + template = ERB.new(IO.read(template_file)) + chef_psm1 = template.result + File.open(::File.join(psm1_path, "chef.psm1"), "w") { |f| f.write(chef_psm1) } end task install: :super_install |