1
0
Fork 0
mirror of https://github.com/Luzifer/git-changerelease.git synced 2024-12-20 11:01:16 +00:00

Fix: Write default config to right location

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2018-07-03 09:57:07 +02:00
parent 5353ad2f71
commit 7805b55b51
Signed by: luzifer
GPG key ID: DC2729FDD34BE99E

View file

@ -21,7 +21,8 @@ func loadConfig() (*configFile, error) {
return nil, errors.New("Config file does not exist, use --create-config to create one")
}
if err = yaml.Unmarshal(MustAsset("assets/git_changerelease.yaml"), &config); err != nil {
c := &configFile{}
if err = yaml.Unmarshal(MustAsset("assets/git_changerelease.yaml"), c); err != nil {
return nil, err
}
@ -31,6 +32,5 @@ func loadConfig() (*configFile, error) {
}
defer dataFile.Close()
c := &configFile{}
return c, yaml.NewDecoder(dataFile).Decode(c)
}