diff --git a/gitlab.go b/gitlab.go index 704f429..77771b9 100644 --- a/gitlab.go +++ b/gitlab.go @@ -79,6 +79,7 @@ func (g *gitlabClient) ListTags() ([]*gitlab.Tag, error) { for { tags, res, err := g.client.Tags.ListTags(g.repository, opt) + fmt.Printf("listing tags, page %d out of %d\n", opt.Page, res.TotalPages) if err != nil { return []*gitlab.Tag{}, err } @@ -112,6 +113,7 @@ func (g *gitlabClient) ListTagsUntil(tag_name string) ([]*gitlab.Tag, error) { if err != nil { return []*gitlab.Tag{}, err } + fmt.Printf("listing tags until %s, page %d out of %d\n", tag_name, opt.Page, res.TotalPages) if opt.Page >= res.TotalPages { break @@ -136,6 +138,7 @@ func (g *gitlabClient) GetTag(tag_name string) (*gitlab.Tag, error) { if err != nil { return &gitlab.Tag{}, err } + fmt.Printf("getting tag %s", tag_name) err = res.Body.Close() if err != nil { diff --git a/in_command.go b/in_command.go index 094090d..36b629b 100644 --- a/in_command.go +++ b/in_command.go @@ -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], diff --git a/resources.go b/resources.go index 1d494fa..be1afeb 100644 --- a/resources.go +++ b/resources.go @@ -1,19 +1,11 @@ package resource type Source struct { - Owner string `json:"owner"` Repository string `json:"repository"` - // Deprecated; use Owner instead - User string `json:"user"` - - GitlabAPIURL string `json:"gitlab_api_url"` - GitlabUploadsURL string `json:"gitlab_uploads_url"` - AccessToken string `json:"access_token"` - Drafts bool `json:"drafts"` - PreRelease bool `json:"pre_release"` - Release bool `json:"release"` - Insecure bool `json:"insecure"` + GitlabAPIURL string `json:"gitlab_api_url"` + AccessToken string `json:"access_token"` + Insecure bool `json:"insecure"` TagFilter string `json:"tag_filter"` } @@ -25,19 +17,16 @@ type CheckRequest struct { func NewCheckRequest() CheckRequest { res := CheckRequest{} - res.Source.Release = true return res } func NewOutRequest() OutRequest { res := OutRequest{} - res.Source.Release = true return res } func NewInRequest() InRequest { res := InRequest{} - res.Source.Release = true return res }