summaryrefslogtreecommitdiffstats
path: root/commands/new.go
diff options
context:
space:
mode:
Diffstat (limited to 'commands/new.go')
-rw-r--r--commands/new.go12
1 files changed, 4 insertions, 8 deletions
diff --git a/commands/new.go b/commands/new.go
index f4caff50c..2fb35a9a3 100644
--- a/commands/new.go
+++ b/commands/new.go
@@ -33,15 +33,11 @@ type newCmd struct {
contentEditor string
contentType string
- cmd *cobra.Command
-}
-
-func (c *newCmd) getCommand() *cobra.Command {
- return c.cmd
+ *baseCmd
}
func newNewCmd() *newCmd {
- ccmd := &newCmd{}
+ ccmd := &newCmd{baseCmd: newBaseCmd(nil)}
cmd := &cobra.Command{
Use: "new [path]",
Short: "Create new content for your site",
@@ -57,7 +53,7 @@ If archetypes are provided in your theme or site, they will be used.`,
cmd.Flags().StringVarP(&ccmd.contentType, "kind", "k", "", "content type to create")
// TODO(bep) cli refactor
- cmd.PersistentFlags().StringVarP(&source, "source", "s", "", "filesystem path to read files relative from")
+ // cmd.PersistentFlags().StringVarP(&source, "source", "s", "", "filesystem path to read files relative from")
cmd.PersistentFlags().SetAnnotation("source", cobra.BashCompSubdirsInDir, []string{})
cmd.Flags().StringVar(&ccmd.contentEditor, "editor", "", "edit new content with this editor, if provided")
@@ -77,7 +73,7 @@ func (n *newCmd) newContent(cmd *cobra.Command, args []string) error {
return nil
}
- c, err := InitializeConfig(false, cfgInit)
+ c, err := initializeConfig(false, nil, n, cfgInit)
if err != nil {
return err