From 4d191bb9df0b806306bf21a87ddedb5de0a29364 Mon Sep 17 00:00:00 2001 From: hahwul Date: Fri, 19 Aug 2022 14:33:52 +0900 Subject: [PATCH] Update fetch_lang --- scripts/fetch_lang.rb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/fetch_lang.rb b/scripts/fetch_lang.rb index 8934997..0001a74 100644 --- a/scripts/fetch_lang.rb +++ b/scripts/fetch_lang.rb @@ -13,17 +13,18 @@ Dir.entries("./weapons").each do | name | lang = `curl -s https://api.github.com/repos/#{t[3]}/#{t[4]}/languages | jq 'to_entries | max_by(.value) | .key'` lang_str = lang.gsub("\"","").gsub("\n","") if lang_str != "documentation_url" - puts "hit #{filename}" + puts "hit #{name}" data['lang'] = lang_str yaml_data = YAML.dump(data) - File.write("./weapons/#{filename}", yaml_data) + File.write("./weapons/#{name}", yaml_data) langs.push lang_str else - puts "denied #{filename}" + puts "denied #{name}" end sleep(90) end - rescue + rescue => e + puts e end end end