5
0
mirror of https://git.coop/cotech/website.git synced 2024-11-16 12:23:06 +00:00
cotech-website/scripts/migrate_coop_logos.rb
2018-11-09 21:50:57 +00:00

12 lines
370 B
Ruby

require_relative 'coop'
require 'fileutils'
base_dir = File.join(File.dirname(__FILE__), 'mirror', 'coops.tech.archived.website', 'co-op')
Coop.all.each do |coop|
current_fn = File.join(base_dir, coop.logo)
ext = File.extname(current_fn)
new_fn = File.join(File.dirname(__FILE__), '..', 'images', 'coops', coop.slug + ext)
FileUtils.cp(current_fn, new_fn)
end