commands: Re-add the missing releaser command

This commit is contained in:
Bjørn Erik Pedersen 2018-04-16 08:23:32 +02:00
parent 7c597c7d75
commit f21b827f7b
No known key found for this signature in database
GPG key ID: 330E6E2BD4859D8F
4 changed files with 54 additions and 2 deletions

View file

@ -49,6 +49,7 @@ func (b *commandsBuilder) addAll() *commandsBuilder {
newListCmd(),
newImportCmd(),
newGenCmd(),
createReleaser(),
)
return b
@ -62,7 +63,11 @@ func (b *commandsBuilder) build() *hugoCmd {
func addCommands(root *cobra.Command, commands ...cmder) {
for _, command := range commands {
root.AddCommand(command.getCommand())
cmd := command.getCommand()
if cmd == nil {
continue
}
root.AddCommand(cmd)
}
}
@ -110,6 +115,19 @@ type hugoCmd struct {
c *commandeer
}
var _ cmder = (*nilCommand)(nil)
type nilCommand struct {
}
func (c *nilCommand) getCommand() *cobra.Command {
return nil
}
func (c *nilCommand) flagsToConfig(cfg config.Provider) {
}
func (b *commandsBuilder) newHugoCmd() *hugoCmd {
cc := &hugoCmd{}