Documentation ¶
Overview ¶
Copyright © 2023 Adharsh M dev@adharsh.in
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var GenerateCmd = &cobra.Command{ Use: "generate", Short: "Generate a project with gsk and clean architecture.", Args: cobra.MaximumNArgs(1), Run: func(cmd *cobra.Command, args []string) { log.Println("Generating project files...") workdir := getWorkDirFromArg(args) err := openDirectory(workdir) if err != nil { log.Fatal(err) return } var pkg string packageNameFromGit, err := getRepoName() if err == nil && packageNameFromGit != "" { log.Println("using existing git repo name: ", packageNameFromGit) pkg = packageNameFromGit } else { pkg = viper.GetString("project.package") randomName := project.RandomName() if pkg == "" { pkg = randomName } } app := getAppNameFromPkgName(pkg) config := &project.Config{ RootPath: workdir, PkgName: pkg, AppName: app, } err = project.Generate(config) if err != nil { log.Fatal(err) return } log.Println("Project generated successfully.") }, }
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.