minor tweak to prevent exceptions in some templates

set default for "commit" command to use editor
This commit is contained in:
Cory Bennett
2015-02-17 16:03:32 -08:00
parent 005607d799
commit f7ab5753e9
3 changed files with 5 additions and 4 deletions
+1 -1
View File
@@ -496,7 +496,7 @@ func (c *Cli) CmdComment(issue string) error {
}
}
if comment, ok := c.opts["comment"]; ok {
if comment, ok := c.opts["comment"]; ok && comment != "" {
json, err := jsonEncode(map[string]interface{}{
"body": comment,
})
+3 -3
View File
@@ -35,11 +35,11 @@ blockers: {{ range .fields.issuelinks }}{{if .outwardIssue}}{{ .outwardIssue.key
depends: {{ range .fields.issuelinks }}{{if .inwardIssue}}{{ .inwardIssue.key }}[{{.inwardIssue.fields.status.name}}]{{end}}{{end}}
priority: {{ .fields.priority.name }}
description: |
{{ if .fields.description }}{{.fields.description | indent 2 }}{{end}}
{{ or .fields.description "" | indent 2 }}
comments:
{{ range .fields.comment.comments }} - | # {{.author.name}} at {{.created}}
{{ .body | indent 4}}
{{ or .body "" | indent 4}}
{{end}}
`
const default_edit_template = `update:
@@ -93,7 +93,7 @@ const default_create_template = `fields:
`
const default_comment_template = `body: |
{{ or .overrides.comment | indent 2 }}
{{ or .overrides.comment "" | indent 2 }}
`
const default_transition_template = `update:
+1
View File
@@ -251,6 +251,7 @@ Command Options:
setEditing(false)
err = c.CmdTransition(args["ISSUE"].(string), "stop")
} else if validCommand("comment") {
setEditing(true)
err = c.CmdComment(args["ISSUE"].(string))
} else if validCommand("take") {
err = c.CmdAssign(args["ISSUE"].(string), user)