@@ -29,13 +29,13 @@ var (
2929
3030// WriteConfig saves the configurations to a file
3131// in the specified output format
32- func WriteConfig (opts * options , config * configValues ) error {
32+ func WriteConfig (opts * options , config * configValues ) ( string , error ) {
3333
3434 var fileBody bytes.Buffer
3535 fileTemplate := getFileFormat (opts .configType )
3636 err := fileTemplate .Execute (& fileBody , config )
3737 if err != nil {
38- return err
38+ return "" , err
3939 }
4040
4141 fileData := []byte (fileBody .String ())
@@ -47,10 +47,10 @@ func WriteConfig(opts *options, config *configValues) error {
4747 // indicating that the user should explicitly request overwriting of the file
4848 _ , err = os .Stat (opts .fileName )
4949 if err == nil && ! opts .overwrite {
50- return opts .localizer .MustLocalizeError ("generate.error.configFileAlreadyExists" , localize .NewEntry ("FilePath" , opts .fileName ))
50+ return "" , opts .localizer .MustLocalizeError ("generate.error.configFileAlreadyExists" , localize .NewEntry ("FilePath" , opts .fileName ))
5151 }
5252
53- return ioutil .WriteFile (opts .fileName , fileData , 0o600 )
53+ return opts . fileName , ioutil .WriteFile (opts .fileName , fileData , 0o600 )
5454}
5555
5656// getDefaultPath returns the default absolute path for the configuration file
0 commit comments