File tree Expand file tree Collapse file tree 2 files changed +3
-21
lines changed
Expand file tree Collapse file tree 2 files changed +3
-21
lines changed Original file line number Diff line number Diff line change @@ -165,10 +165,7 @@ func (c *fsContext) Config() (config.Config, error) {
165165 if c .config == nil {
166166 cfg , err := config .ParseDefaultConfig ()
167167 if errors .Is (err , os .ErrNotExist ) {
168- cfg , err = config .InitDefaultConfig ()
169- if err != nil {
170- return nil , fmt .Errorf ("could not create default config: %w" , err )
171- }
168+ cfg = config .NewBlankConfig ()
172169 } else if err != nil {
173170 return nil , err
174171 }
Original file line number Diff line number Diff line change @@ -122,8 +122,8 @@ func NewConfig(root *yaml.Node) Config {
122122 }
123123}
124124
125- func InitDefaultConfig () ( Config , error ) {
126- cfg := NewConfig (& yaml.Node {
125+ func NewBlankConfig () Config {
126+ return NewConfig (& yaml.Node {
127127 Kind : yaml .DocumentNode ,
128128 Content : []* yaml.Node {
129129 {
@@ -169,21 +169,6 @@ func InitDefaultConfig() (Config, error) {
169169 },
170170 },
171171 })
172-
173- err := cfg .Write ()
174- if err != nil {
175- return nil , err
176- }
177-
178- return cfg , nil
179-
180- }
181-
182- func NewBlankConfig () Config {
183- return NewConfig (& yaml.Node {
184- Kind : yaml .DocumentNode ,
185- Content : []* yaml.Node {{Kind : yaml .MappingNode }},
186- })
187172}
188173
189174// This type implements a Config interface and represents a config file on disk.
You can’t perform that action at this time.
0 commit comments