summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2024-05-24 12:55:17 -0600
committermo khan <mo@mokhan.ca>2024-05-24 12:55:17 -0600
commitd07c42e49a8933dcc1e99778c427648ee57ea948 (patch)
treec8bd5978d2d73d285439c81eb2eb6c7506c539e0
parent1384edf8306294a69c079788cb2bd32d1001b930 (diff)
Insert shim for where the sector readme can be generated
-rwxr-xr-xbin/build13
1 files changed, 9 insertions, 4 deletions
diff --git a/bin/build b/bin/build
index 6846c0a..73181ca 100755
--- a/bin/build
+++ b/bin/build
@@ -52,10 +52,9 @@ class Community
[self[:sector], self.name] <=> [other[:sector], other.name]
end
- def create_content_in(root_dir)
- target_dir = "#{root_dir}/#{self[:sector].parameterize}/#{name.parameterize}"
+ def create_content_in(dir)
+ target_dir = "#{dir}/#{name.parameterize}"
FileUtils.mkdir_p(target_dir, verbose: true)
- spawn "touch #{root_dir}/#{self[:sector].parameterize}/README.md"
create_readme_in(target_dir)
end
@@ -90,7 +89,13 @@ class Census
erb = ERB.new(IO.read("templates/city.md.erb"), trim_mode: "-")
IO.write("#{dir}/README.md", erb.result(binding))
- each { |x| x.create_content_in(dir) }
+
+ each do |community|
+ target_dir = "#{dir}/#{community[:sector].parameterize}"
+ FileUtils.mkdir_p(target_dir, verbose: true)
+ spawn "touch #{target_dir}/README.md"
+ community.create_content_in(target_dir)
+ end
end
end