Skip to content
This repository has been archived by the owner on Sep 27, 2018. It is now read-only.

Commit

Permalink
Fix delete-template command
Browse files Browse the repository at this point in the history
  • Loading branch information
olivere committed Sep 21, 2016
1 parent 71e450c commit 0d39061
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions delete_template.go
Expand Up @@ -26,13 +26,10 @@ func runDeleteTemplate(cmd *Command, args []string) {
template := args[0]

var response struct {
Ok bool `json:"ok,omitempty"`
Ack bool `json:"acknowledged,omitempty"`
Error string `json:"error,omitempty"`
Status int `json:"status,omitempty"`
Ack bool `json:"acknowledged,omitempty"`
}
ESReq("DELETE", "/_template/"+template).Do(&response)
if !force && len(response.Error) > 0 {
log.Fatalf("Error: %v (%v)\n", response.Error, response.Status)
if !force && !response.Ack {
log.Fatalf("Error: %v\n", response)
}
}

0 comments on commit 0d39061

Please sign in to comment.