adding "comment" command

This commit is contained in:
Cory Bennett
2015-02-13 12:33:47 -08:00
parent 0b5e00d2e3
commit 4a33dd8e20
4 changed files with 62 additions and 14 deletions
+12 -10
View File
@@ -248,17 +248,19 @@ func (c *Cli) editTemplate(template string, tmpFilePrefix string, templateData m
} else {
edited = fixed.(map[string]interface{})
}
mf := templateData["meta"].(map[string]interface{})["fields"]
f := edited["fields"].(map[string]interface{})
for k, _ := range f {
if _, ok := mf.(map[string]interface{})[k]; !ok {
err := fmt.Errorf("Field %s is not editable", k)
log.Error("%s", err)
if promptYN("edit again?", true) {
continue
if _, ok := templateData["meta"]; ok {
mf := templateData["meta"].(map[string]interface{})["fields"]
f := edited["fields"].(map[string]interface{})
for k, _ := range f {
if _, ok := mf.(map[string]interface{})[k]; !ok {
err := fmt.Errorf("Field %s is not editable", k)
log.Error("%s", err)
if promptYN("edit again?", true) {
continue
}
return err
}
return err
}
}