From 134abec4e7e362052cdfc859d8c9fe9c24a218b4 Mon Sep 17 00:00:00 2001 From: hahwul Date: Tue, 27 Oct 2020 01:48:44 +0900 Subject: [PATCH] Added install/update script ignore logic in add tools --- add-tool.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/add-tool.go b/add-tool.go index 08ba2ae..b21f485 100644 --- a/add-tool.go +++ b/add-tool.go @@ -83,6 +83,17 @@ func writeJSON(category, name, method, data, udesc string) { Install: install, Update: update, } + if result[name] != nil { + resultData := result[name].(map[string]interface{}) + resultInstall := resultData["Install"].(map[string]interface{}) + resultUpdate := resultData["Update"].(map[string]interface{}) + tool.Install["MacOS"] = resultInstall["MacOS"].(string) + tool.Install["Linux"] = resultInstall["Linux"].(string) + tool.Install["Windows"] = resultInstall["Windows"].(string) + tool.Update["MacOS"] = resultUpdate["MacOS"].(string) + tool.Update["Linux"] = resultUpdate["Linux"].(string) + tool.Update["Windows"] = resultUpdate["Windows"].(string) + } result[name] = tool file, _ := json.MarshalIndent(result, "", " ") _ = ioutil.WriteFile("data.json", file, 0644)