From df6ea623721722e635d1f136d29c3d29aebe7a62 Mon Sep 17 00:00:00 2001 From: Charlotte Koch Date: Tue, 19 Nov 2024 14:47:35 -0800 Subject: Add a bunch of missing files for "willora new" --- lib/willora/willora.rb | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/willora/willora.rb b/lib/willora/willora.rb index 1867fbb..9cfe62f 100644 --- a/lib/willora/willora.rb +++ b/lib/willora/willora.rb @@ -95,8 +95,12 @@ class Willora templates = { "Makefile.erb" => "", + "acknowledgments.adoc.erb" => "adoc", + "backmatter.adoc.erb" => "adoc", + "biography.adoc.erb" => "adoc", "CHAP01.adoc.erb" => "adoc", - "frontmatter.adoc.erb" => "adoc", + "dedication.adoc.erb" => "adoc", + "frontmatter-template.adoc.erb" => "adoc", "part01.adoc.erb" => "adoc", } @@ -107,7 +111,14 @@ class Willora end templatefile = File.join(_templatedir, template) result = ERB.new(File.read(templatefile)).result(binding) - newfile = File.join(destdir, File.basename(template, ".erb")) + + # This file gets installed *with* the .erb extension. + if template == "frontmatter-template.adoc.erb" + newfile = File.join(destdir, template) + else + newfile = File.join(destdir, File.basename(template, ".erb")) + end + puts "GENERATE #{newfile}" File.open(newfile, "w") do |fp| fp.puts(result) -- cgit v1.2.3