Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var InitCmd = &cobra.Command{ Use: "init", Short: "init setups package management for the project", Long: `init setups package management for the project. It setups Nix files based on the language detected. `, PreRun: func(cmd *cobra.Command, args []string) { precheck.AllPrechecks() }, Run: func(cmd *cobra.Command, args []string) { conf, err := configure.PreCheckConf() if err != nil { fmt.Println(styles.ErrorStyle.Render("error:", err.Error())) os.Exit(1) } isBaseImage, err := yesNoPrompt("Do you want to build a base image?") if err != nil { fmt.Println(styles.ErrorStyle.Render("error:", err.Error())) os.Exit(1) } var imageName string var pt langdetect.ProjectType if isBaseImage { imageName, err = ioPrompt("What should the image name be?") if err != nil { fmt.Println(styles.ErrorStyle.Render("error:", err.Error())) os.Exit(1) } pt = langdetect.BaseImage } sc, err := search.NewClientWithAddr(conf.BuildSafeAPI, conf.BuildSafeAPITLS) if err != nil { fmt.Println(styles.ErrorStyle.Render("error:", err.Error())) os.Exit(1) } m := model{sc: sc, pt: pt, baseImgName: imageName} m.resetSpinner() if _, err := tea.NewProgram(m).Run(); err != nil { os.Exit(1) } }, }
InitCmd represents the init command
Functions ¶
func GetBSFInitializers ¶
func GetBSFInitializers() (bsfv1.SearchServiceClient, *hcl2nix.FileHandlers, error)
GetBSFInitializers generates the nix files
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.