github.com/kcmvp/gob@v1.0.17/cmd/gbc/command/initialize.go (about)

     1  /*
     2  Copyright © 2023 kcmvp <kcheng.mvp@gmail.com>
     3  */
     4  package command
     5  
     6  import (
     7  	"fmt"
     8  	"github.com/kcmvp/gob/cmd/gbc/artifact"
     9  	"github.com/spf13/cobra"
    10  )
    11  
    12  func initProject(_ *cobra.Command, _ []string) {
    13  	fmt.Println("Initialize project ......")
    14  	artifact.CurProject().SetupHooks(true)
    15  }
    16  
    17  // initializerCmd represents the init command
    18  var initializerCmd = &cobra.Command{
    19  	Use:   "init",
    20  	Short: "Initialize project",
    21  	Long: `It will generate main.go file together with below initialization:
    22  	1: Init git hooks
    23  	2: Setup plugin(test,lint)
    24  	3: Initialize application.yaml
    25  	4: Necessary dependencies`,
    26  	Run: initProject,
    27  }
    28  
    29  func init() {
    30  	rootCmd.AddCommand(initializerCmd)
    31  }