summaryrefslogtreecommitdiff
path: root/Rakefile
diff options
context:
space:
mode:
Diffstat (limited to 'Rakefile')
-rw-r--r--Rakefile9
1 files changed, 9 insertions, 0 deletions
diff --git a/Rakefile b/Rakefile
index 643d70015b..b54411af4c 100644
--- a/Rakefile
+++ b/Rakefile
@@ -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