2022-07-15 11:49:53 +00:00
|
|
|
/*
|
2022-07-16 15:46:09 +00:00
|
|
|
Copyright © 2022 Matthieu Derasse <git@derasse.fr>
|
2022-07-15 11:49:53 +00:00
|
|
|
|
|
|
|
*/
|
|
|
|
package cmd
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
|
|
|
|
"git.home.m-and-m.ovh/mderasse/boot/helpers"
|
|
|
|
"github.com/spf13/cobra"
|
|
|
|
)
|
|
|
|
|
|
|
|
// generateCmd represents the generate command
|
|
|
|
var generateCmd = &cobra.Command{
|
|
|
|
Use: "generate",
|
|
|
|
Short: "Generate all the files (API, DB, ...)",
|
|
|
|
Long: `Generate will automatically create all the files of the Project.
|
|
|
|
You can also generate files for each 'modules' by using the command bellows`,
|
|
|
|
Run: func(cmd *cobra.Command, args []string) {
|
|
|
|
|
|
|
|
if isStrap, err := helpers.IsStrapProject(); err != nil {
|
|
|
|
|
|
|
|
fmt.Print("Fail to check if we are in a Strap Directory")
|
|
|
|
|
|
|
|
} else if !isStrap {
|
|
|
|
fmt.Printf("You are not in a Strap Project directory\n")
|
|
|
|
return
|
|
|
|
}
|
|
|
|
fmt.Println("generate called")
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
rootCmd.AddCommand(generateCmd)
|
|
|
|
}
|