commands: Fix config environment handling

Fixes #6503
Fixes #6824
This commit is contained in:
Bjørn Erik Pedersen
2020-01-31 09:09:11 +01:00
parent 0792cfa9fa
commit 2bbc865f7b
13 changed files with 211 additions and 204 deletions

View File

@@ -29,12 +29,11 @@ import (
var _ cmder = (*newThemeCmd)(nil)
type newThemeCmd struct {
*baseCmd
hugoBuilderCommon
*baseBuilderCmd
}
func newNewThemeCmd() *newThemeCmd {
ccmd := &newThemeCmd{baseCmd: newBaseCmd(nil)}
func (b *commandsBuilder) newNewThemeCmd() *newThemeCmd {
cc := &newThemeCmd{}
cmd := &cobra.Command{
Use: "theme [name]",
@@ -43,12 +42,12 @@ func newNewThemeCmd() *newThemeCmd {
New theme is a skeleton. Please add content to the touched files. Add your
name to the copyright line in the license and adjust the theme.toml file
as you see fit.`,
RunE: ccmd.newTheme,
RunE: cc.newTheme,
}
ccmd.cmd = cmd
cc.baseBuilderCmd = b.newBuilderBasicCmd(cmd)
return ccmd
return cc
}
// newTheme creates a new Hugo theme template