Sha256: cad8e0590785b86f59c56f046e2ef9c167a61ec53d6fb1c4841f7ad0a972aefe
Contents?: true
Size: 813 Bytes
Versions: 7
Compression:
Stored size: 813 Bytes
Contents
module Souls class Sync < Thor desc "model", "Sync Model, DB, Factory Files with API" def model cp_dir = %w[db app/models spec/factories] cp_dir.each do |dir| cp_and_dl_files(dir: dir) end end private def cp_and_dl_files(dir: "db") require("#{Souls.get_mother_path}/config/souls") worker_paths = Souls.configuration.workers.map { |n| n[:name] } worker_paths.each do |path| cp_path = "./apps/api/#{dir}" old_path = "./apps/#{path}/#{dir}" system("rm -rf #{old_path}", chdir: Souls.get_mother_path) system("mkdir -p #{old_path}", chdir: Souls.get_mother_path) system("cp -r #{cp_path}/* #{old_path}", chdir: Souls.get_mother_path) rescue StandardError # Do nothing end end end end
Version data entries
7 entries across 7 versions & 1 rubygems