summaryrefslogtreecommitdiffstats
path: root/commands/import.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/import.go
parent7ce033a89d411036e40dbb42325e30e12248bda9 (diff)
downloadhugo-8a69ccbb00e7978c6c5d57e353ce178c2b732b07.tar.gz
hugo-8a69ccbb00e7978c6c5d57e353ce178c2b732b07.zip
commands: Improve the common build flag handling
Updates #10947
Diffstat (limited to 'commands/import.go')
-rw-r--r--commands/import.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/commands/import.go b/commands/import.go
index 20d23dfac..258323a3a 100644
--- a/commands/import.go
+++ b/commands/import.go
@@ -90,7 +90,8 @@ func (c *importCommand) Run(ctx context.Context, cd *simplecobra.Commandeer, arg
return nil
}
-func (c *importCommand) WithCobraCommand(cmd *cobra.Command) error {
+func (c *importCommand) Init(cd *simplecobra.Commandeer) error {
+ cmd := cd.CobraCommand
cmd.Short = "Import your site from others."
cmd.Long = `Import your site from other web site generators like Jekyll.
@@ -99,7 +100,7 @@ Import requires a subcommand, e.g. ` + "`hugo import jekyll jekyll_root_path tar
return nil
}
-func (c *importCommand) Init(cd, runner *simplecobra.Commandeer) error {
+func (c *importCommand) PreRun(cd, runner *simplecobra.Commandeer) error {
c.r = cd.Root.Command.(*rootCommand)
return nil
}