summaryrefslogtreecommitdiffstats
path: root/commands/import_jekyll.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2018-04-10 09:19:26 +0200
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2018-04-11 09:50:19 +0200
commit4d32f2fa8969f368b088dc9bcedb45f2c986cb27 (patch)
treea091c49f6011605f08b92b9dbdb2d2acdd87f9ce /commands/import_jekyll.go
parent018602c46db8d729af2871bd5f4c1e7480420f09 (diff)
commands: Make the hugo command non-global
See #4598
Diffstat (limited to 'commands/import_jekyll.go')
-rw-r--r--commands/import_jekyll.go15
1 files changed, 4 insertions, 11 deletions
diff --git a/commands/import_jekyll.go b/commands/import_jekyll.go
index df36951c9..af8a5acb2 100644
--- a/commands/import_jekyll.go
+++ b/commands/import_jekyll.go
@@ -35,27 +35,23 @@ import (
jww "github.com/spf13/jwalterweatherman"
)
-var _ cmder = (*newThemeCmd)(nil)
+var _ cmder = (*importCmd)(nil)
type importCmd struct {
- cmd *cobra.Command
-}
-
-func (c *importCmd) getCommand() *cobra.Command {
- return c.cmd
+ *baseCmd
}
func newImportCmd() *importCmd {
cc := &importCmd{}
- cc.cmd = &cobra.Command{
+ cc.baseCmd = newBaseCmd(&cobra.Command{
Use: "import",
Short: "Import your site from others.",
Long: `Import your site from other web site generators like Jekyll.
Import requires a subcommand, e.g. ` + "`hugo import jekyll jekyll_root_path target_path`.",
RunE: nil,
- }
+ })
importJekyllCmd := &cobra.Command{
Use: "jekyll",
@@ -74,9 +70,6 @@ Import from Jekyll requires two paths, e.g. ` + "`hugo import jekyll jekyll_root
}
-func init() {
-}
-
func (i *importCmd) importFromJekyll(cmd *cobra.Command, args []string) error {
if len(args) < 2 {