From 2d6c4a01ce755e26ecd9b2a19512a378f014a760 Mon Sep 17 00:00:00 2001 From: Nandan Sridhar Date: Tue, 30 Jul 2019 20:17:13 -0700 Subject: [PATCH] prod is optional --- cmd/apps/crtapp/crtapp.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cmd/apps/crtapp/crtapp.go b/cmd/apps/crtapp/crtapp.go index eb530148..da43fabf 100644 --- a/cmd/apps/crtapp/crtapp.go +++ b/cmd/apps/crtapp/crtapp.go @@ -19,7 +19,10 @@ var Cmd = &cobra.Command{ app := []string{} app = append(app, "\"name\":\""+name+"\"") - app = append(app, "\"apiProducts\":[\""+getArrayStr(apiProducts)+"\"]") + + if len(apiProducts) > 0 { + app = append(app, "\"apiProducts\":[\""+getArrayStr(apiProducts)+"\"]") + } if callback != "" { app = append(app, "\"callbackUrl\":\""+callback+"\"") @@ -71,7 +74,6 @@ func init() { _ = Cmd.MarkFlagRequired("name") _ = Cmd.MarkFlagRequired("email") - _ = Cmd.MarkFlagRequired("prods") } func getArrayStr(str []string) string {