From 31c5d8206354db10d003a571f28817cd99df9c32 Mon Sep 17 00:00:00 2001 From: hahwul Date: Mon, 15 Aug 2022 23:19:18 +0900 Subject: [PATCH] update migration --- scripts/migration.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/migration.rb b/scripts/migration.rb index 63ef307..cfb6aba 100644 --- a/scripts/migration.rb +++ b/scripts/migration.rb @@ -20,7 +20,7 @@ def get_urls str return URI.extract(str).uniq end -def migrate jsonfile +def migrate jsonfile, category file = File.read(jsonfile) data_hash = JSON.parse(file) @@ -31,7 +31,7 @@ def migrate jsonfile new_obj['name'] = name new_obj['description'] = obj['Description'] new_obj['urls'] = get_urls obj['Data'] - new_obj['category'] = 'tool' + new_obj['category'] = category new_obj['types'] = [] if obj['Install'] != nil new_obj['os'] = get_os(obj['Install']) @@ -48,7 +48,7 @@ def migrate jsonfile end end -migrate './data.json' -migrate './Bookmarklets/data.json' -migrate './Browser Extensions/data.json' -migrate './Burp and ZAP Extensions/data.json' \ No newline at end of file +migrate './data.json', 'tool' +migrate './Bookmarklets/data.json', 'bookmarklet' +migrate './Browser Extensions/data.json', 'browser-addon' +migrate './Burp and ZAP Extensions/data.json', 'tool-addon' \ No newline at end of file