File tree Expand file tree Collapse file tree 2 files changed +23
-19
lines changed Expand file tree Collapse file tree 2 files changed +23
-19
lines changed Original file line number Diff line number Diff line change @@ -35,25 +35,7 @@ var rootCmd = &cobra.Command{
35
35
logger .Debugf ("Error in loading config file: " , err )
36
36
logger .Info ("Config file not found, creating a new one..." )
37
37
38
- cfg = config.Config {
39
- Username : "" ,
40
- Token : "" ,
41
- Platform : "github" ,
42
- Server : config.Server {
43
- Domain : "github.com" ,
44
- Protocol : "https" ,
45
- },
46
- IncludeRepos : []string {},
47
- ExcludeRepos : []string {},
48
- IncludeOrgs : []string {},
49
- ExcludeOrgs : []string {},
50
- IncludeForks : false ,
51
- IncludeWiki : true ,
52
- Workspace : "" ,
53
- Cron : "" ,
54
- BackupDir : config .GetBackupDir (backupDir ),
55
- CloneType : "bare" ,
56
- }
38
+ cfg = config .GetInitialConfig ()
57
39
58
40
err = config .SaveConfig (cfg , cfgFile )
59
41
if err != nil {
Original file line number Diff line number Diff line change @@ -110,3 +110,25 @@ func SaveConfig(config Config, cfgFile string) error {
110
110
111
111
return viper .WriteConfig ()
112
112
}
113
+
114
+ func GetInitialConfig () Config {
115
+ return Config {
116
+ Username : "" ,
117
+ Token : "" ,
118
+ Platform : "github" ,
119
+ Server : Server {
120
+ Domain : "github.com" ,
121
+ Protocol : "https" ,
122
+ },
123
+ IncludeRepos : []string {},
124
+ ExcludeRepos : []string {},
125
+ IncludeOrgs : []string {},
126
+ ExcludeOrgs : []string {},
127
+ IncludeForks : false ,
128
+ IncludeWiki : true ,
129
+ Workspace : "" ,
130
+ Cron : "" ,
131
+ BackupDir : GetBackupDir ("" ),
132
+ CloneType : "bare" ,
133
+ }
134
+ }
You can’t perform that action at this time.
0 commit comments