allow "abort: true" to be set while editing to cancel the edit operation

This commit is contained in:
Cory Bennett
2015-09-11 23:47:09 -07:00
parent 99f62a9e99
commit ea67a77863
+8
View File
@@ -299,6 +299,14 @@ func (c *Cli) editTemplate(template string, tmpFilePrefix string, templateData m
edited = fixed.(map[string]interface{})
}
// if you want to abort editing a jira issue then
// you can add the "abort: true" flag to the document
// and we will abort now
if val, ok := edited["abort"].(bool); ok && val {
log.Info("abort flag found in template, quiting")
return fmt.Errorf("abort flag found in template, quiting")
}
if _, ok := templateData["meta"]; ok {
mf := templateData["meta"].(map[string]interface{})["fields"]
if f, ok := edited["fields"].(map[string]interface{}); ok {