Bug fixes and logging

This commit is contained in:
Ed
2018-12-16 23:02:46 -05:00
parent 74430d5d22
commit 130c7c1c06
3 changed files with 14 additions and 18 deletions

View File

@@ -128,10 +128,14 @@ func (c *InCommand) getAttachments(releaseBody string) ([]attachment, error) {
lines := strings.Split(releaseBody, "\n")
for _, line := range lines {
nameStart := strings.Index(line, "[") + 1
nameEnd := strings.Index(line, "]") - 1
urlStart := strings.Index(line, "(") + 1
urlEnd := strings.Index(line, ")") - 1
nameStart := strings.Index(line, "[")
nameEnd := strings.Index(line, "]")
urlStart := strings.Index(line, "(")
urlEnd := strings.Index(line, ")")
if nameStart == -1 || nameEnd == -1 || urlStart == -1 || urlEnd == -1 {
continue
}
attachments = append(attachments, attachment{
Name: line[nameStart:nameEnd],