MCPcopy Index your code
hub / github.com/commitdev/zero / Create

Function Create

cmd/create.go:37–61  ·  view source on GitHub ↗
(dir string, createConfigPath string)

Source from the content-addressed store, hash-verified

35}
36
37func Create(dir string, createConfigPath string) {
38 if strings.Trim(createConfigPath, " ") == "" {
39 exit.Fatal("config path cannot be empty!")
40 }
41 configFilePath := path.Join(dir, createConfigPath)
42 projectConfig := projectconfig.LoadConfig(configFilePath)
43
44 generate.Generate(*projectConfig, overwriteFiles)
45
46 if projectConfig.ShouldPushRepositories {
47 flog.Infof(":up_arrow: Done Rendering - committing repositories to version control.")
48
49 for _, module := range projectConfig.Modules {
50 err, githubApiKey := projectconfig.ReadVendorCredentialsFromModule(module, "github")
51 if err != nil {
52 flog.Errorf(err.Error())
53 }
54 vcs.InitializeRepository(module.Files.Repository, githubApiKey)
55 }
56 } else {
57 flog.Infof(":up_arrow: Done Rendering - you will need to commit the created projects to version control.")
58 }
59
60 flog.Infof(":check_mark_button: Done - run zero apply to create any required infrastructure or execute any other remote commands to prepare your environments.")
61}

Callers 1

create.goFile · 0.85

Calls 8

FatalFunction · 0.92
LoadConfigFunction · 0.92
GenerateFunction · 0.92
InfofFunction · 0.92
ErrorfFunction · 0.92
InitializeRepositoryFunction · 0.92
ErrorMethod · 0.45

Tested by

no test coverage detected