CreateConfig creates a default configuration and saves it to the app's cfgFile.
(app *App)
| 635 | |
| 636 | // CreateConfig creates a default configuration and saves it to the app's cfgFile. |
| 637 | func CreateConfig(app *App) error { |
| 638 | log.Info("Creating configuration...") |
| 639 | c := config.New() |
| 640 | log.Info("Saving configuration %s...", app.cfgFile) |
| 641 | err := config.Save(c, app.cfgFile) |
| 642 | if err != nil { |
| 643 | return fmt.Errorf("Unable to save configuration: %v", err) |
| 644 | } |
| 645 | return nil |
| 646 | } |
| 647 | |
| 648 | // DoConfig runs the interactive configuration process. |
| 649 | func DoConfig(app *App, configSections string) { |
no test coverage detected