diff options
author | Anthony Fok <foka@debian.org> | 2018-06-11 01:42:37 -0600 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2018-06-11 10:40:22 +0200 |
commit | 692ec008726b570c9b30ac3391774cbb622730cb (patch) | |
tree | b953a5d94f9afa421418982d8914d4ba96f75a6c /commands/new_theme.go | |
parent | d3dd74fd655c22f21e91e38edb1d377a1357e3be (diff) |
commands: Make "new theme" feedback more intuitive
Diffstat (limited to 'commands/new_theme.go')
-rw-r--r-- | commands/new_theme.go | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/commands/new_theme.go b/commands/new_theme.go index 9464e1968..e01790dee 100644 --- a/commands/new_theme.go +++ b/commands/new_theme.go @@ -14,16 +14,14 @@ package commands import ( - "path/filepath" - "bytes" - + "errors" + "path/filepath" "strings" "time" - "github.com/gohugoio/hugo/hugofs" - "github.com/gohugoio/hugo/helpers" + "github.com/gohugoio/hugo/hugofs" "github.com/spf13/cobra" jww "github.com/spf13/jwalterweatherman" ) @@ -53,6 +51,7 @@ as you see fit.`, return ccmd } +// newTheme creates a new Hugo theme template func (n *newThemeCmd) newTheme(cmd *cobra.Command, args []string) error { c, err := initializeConfig(false, false, &n.hugoBuilderCommon, n, nil) @@ -65,12 +64,12 @@ func (n *newThemeCmd) newTheme(cmd *cobra.Command, args []string) error { } createpath := c.hugo.PathSpec.AbsPathify(filepath.Join(c.Cfg.GetString("themesDir"), args[0])) - jww.INFO.Println("creating theme at", createpath) + jww.FEEDBACK.Println("Creating theme at", createpath) cfg := c.DepsCfg if x, _ := helpers.Exists(createpath, cfg.Fs.Source); x { - return newUserError(createpath, "already exists") + return errors.New(createpath + " already exists") } mkdir(createpath, "layouts", "_default") |