$stdout.sync = true require_relative '../lib/help-desk-dashboard/provider_factory' ENV['HTTP_PROXY'] = nil ENV['CONFIG_FILE'] ||= 'config.json' config = JSON.parse File.read(ENV['CONFIG_FILE']) config['thread_limit'] = ENV['THREAD_LIMIT'] ||= '5' provider_factory = ProviderFactory.new provider = provider_factory.create config requests = provider.get_requests public_web_dir = File.join File.dirname(__FILE__) + '/../lib/help-desk-dashboard/web/public' data_file = File.join public_web_dir, 'data.json' File.write data_file, requests.to_json FileUtils.cp_r "#{public_web_dir}/.", config['output_dir'] puts 'Done.'