diff options
| author | mo khan <mo@mokhan.ca> | 2024-05-24 12:55:17 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2024-05-24 12:55:17 -0600 |
| commit | d07c42e49a8933dcc1e99778c427648ee57ea948 (patch) | |
| tree | c8bd5978d2d73d285439c81eb2eb6c7506c539e0 | |
| parent | 1384edf8306294a69c079788cb2bd32d1001b930 (diff) | |
Insert shim for where the sector readme can be generated
| -rwxr-xr-x | bin/build | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -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 |
