Skip to content
This repository has been archived by the owner on May 6, 2022. It is now read-only.

Commit

Permalink
prod is optional
Browse files Browse the repository at this point in the history
  • Loading branch information
srinandan committed Jul 31, 2019
1 parent f0d3e67 commit 2d6c4a0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cmd/apps/crtapp/crtapp.go
Original file line number Diff line number Diff line change
Expand Up @@ -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+"\"")
Expand Down Expand Up @@ -71,7 +74,6 @@ func init() {

_ = Cmd.MarkFlagRequired("name")
_ = Cmd.MarkFlagRequired("email")
_ = Cmd.MarkFlagRequired("prods")
}

func getArrayStr(str []string) string {
Expand Down

0 comments on commit 2d6c4a0

Please sign in to comment.