summaryrefslogtreecommitdiffstats
path: root/commands/new.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2023-05-17 18:45:23 +0200
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2023-05-17 22:13:29 +0200
commit8a69ccbb00e7978c6c5d57e353ce178c2b732b07 (patch)
treeb2f4a1438ae504555571b3e71a205c9022ec68b2 /commands/new.go
parent7ce033a89d411036e40dbb42325e30e12248bda9 (diff)
commands: Improve the common build flag handling
Updates #10947
Diffstat (limited to 'commands/new.go')
-rw-r--r--commands/new.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/commands/new.go b/commands/new.go
index 3a0e3ad71..5a940a1cd 100644
--- a/commands/new.go
+++ b/commands/new.go
@@ -271,7 +271,8 @@ func (c *newCommand) Run(ctx context.Context, cd *simplecobra.Commandeer, args [
return nil
}
-func (c *newCommand) WithCobraCommand(cmd *cobra.Command) error {
+func (c *newCommand) Init(cd *simplecobra.Commandeer) error {
+ cmd := cd.CobraCommand
cmd.Short = "Create new content for your site"
cmd.Long = `Create a new content file and automatically set the date and title.
It will guess which kind of file to create based on the path provided.
@@ -284,7 +285,7 @@ Ensure you run this within the root directory of your site.`
return nil
}
-func (c *newCommand) Init(cd, runner *simplecobra.Commandeer) error {
+func (c *newCommand) PreRun(cd, runner *simplecobra.Commandeer) error {
c.rootCmd = cd.Root.Command.(*rootCommand)
return nil
}