5
0
mirror of https://git.coop/cotech/website.git synced 2024-11-05 07:58:43 +00:00
cotech-website/scripts/migrate_coop_logos.rb

12 lines
370 B
Ruby
Raw Normal View History

2018-11-09 21:50:57 +00:00
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