Skip to content

Commit

Permalink
Merge pull request #5 from sagar290/RegisterCommand
Browse files Browse the repository at this point in the history
Hotfix: Register command issue
  • Loading branch information
Shipu authored Mar 7, 2023
2 parents b15d8ac + 2c9c4ed commit 72de70c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 0 additions & 2 deletions cmd/generate/cmd.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package generate

import (
"fmt"
"github.com/spf13/afero"
"github.com/spf13/cobra"
"log"
Expand Down Expand Up @@ -35,7 +34,6 @@ func makeCommand(cmd *cobra.Command, args []string) error {
return nil
}


func createCMDFolders(fs afero.Fs, name string) {
fs.Mkdir(name, 0755)
fs.Mkdir(name+"/commands", 0755)
Expand Down
5 changes: 3 additions & 2 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@ func hello(cmd *cobra.Command, args []string) {
log.Println("art command")
}

// add command if necessary
func AddCommand(cmd *cobra.Command) {
// AddCommand add custom command function if necessary
func AddCommand(cmd *cobra.Command) {
RootCmd.AddCommand(cmd)
}

func init() {
RootCmd.AddCommand(generate.CrudCmd)
RootCmd.AddCommand(generate.MakeCommand)
}

func Execute() {
Expand Down

0 comments on commit 72de70c

Please sign in to comment.