Skip to content

Commit

Permalink
Merge pull request #545 from surajnarwade/handle-nocomponent-error
Browse files Browse the repository at this point in the history
Handle error when no component is there
  • Loading branch information
mik-dass authored Jun 29, 2018
2 parents af5ee51 + 2c1bccf commit ac4e3b4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/cmdutils.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ func getComponent(client *occlient.Client, inputComponent, applicationName, proj
if len(inputComponent) == 0 {
c, err := component.GetCurrent(client, applicationName, projectName)
checkError(err, "Could not get current component")
if c == "" {
fmt.Println("There is no component set")
os.Exit(1)
}
return c
}
exists, err := component.Exists(client, inputComponent, applicationName, projectName)
Expand Down

0 comments on commit ac4e3b4

Please sign in to comment.