grim/youtrack-import

Handle comments that end up with no text after processing. This typically happens if it was a reply with the body removed
package bitbucket
import (
"keep.imfreedom.org/grim/youtrack-import/globals"
"keep.imfreedom.org/grim/youtrack-import/youtrack"
)
type Cmd struct {
Archive string `kong:"arg,name='archive',help='The zip file containing the archive'"`
Repository string `kong:"arg,name='repository',help='The repository name on bitbucket.'"`
UsersMapFile string `kong:"arg,name="users-map",help='A key=value file mapping emails to display names'"`
MaxIssues int `kong:"flag,name='max-issues',short='x',help='The maximum number of issues to import.', default='0'"`
}
func (c *Cmd) Run(g *globals.Globals) error {
archive, err := loadArchive(c.Archive)
if err != nil {
return err
}
defer archive.Close()
usersMap, err := NewUsersMap(c.UsersMapFile)
if err != nil {
return err
}
project, err := archive.convert(g.ProjectID, c.Repository, usersMap)
if err != nil {
return err
}
return youtrack.Import(g, project, c.MaxIssues)
}