mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-28 22:50:35 +03:00
commands: Re-add the missing releaser command
This commit is contained in:
parent
7c597c7d75
commit
f21b827f7b
4 changed files with 54 additions and 2 deletions
|
@ -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{}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue