(dir string, createConfigPath string)
| 35 | } |
| 36 | |
| 37 | func 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 | } |
no test coverage detected