()
| 53 | } |
| 54 | |
| 55 | func (i *initCmd) doInit() error { |
| 56 | i.url = strings.TrimSpace(i.url) |
| 57 | i.branch = strings.TrimSpace(i.branch) |
| 58 | |
| 59 | // Initialize celer configuration. |
| 60 | if err := i.celer.Init(); err != nil { |
| 61 | return color.PrintError(err, "Failed to initialize celer.") |
| 62 | } |
| 63 | |
| 64 | // Setup configuration repository. |
| 65 | if err := i.celer.CloneConf(i.url, i.branch, i.force); err != nil { |
| 66 | return color.PrintError(err, "Failed to setup configuration repository.") |
| 67 | } |
| 68 | |
| 69 | if i.branch != "" { |
| 70 | color.PrintSuccess("Successfully initialized celer with repository: %s --branch %s", i.url, i.branch) |
| 71 | } else { |
| 72 | color.PrintSuccess("Successfully initialized celer with repository: %s", i.url) |
| 73 | } |
| 74 | |
| 75 | return nil |
| 76 | } |
| 77 | |
| 78 | func (i *initCmd) completion(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { |
| 79 | var suggestions []string |
no test coverage detected