diff --git a/config.go b/config.go index e7c37f4..e079356 100644 --- a/config.go +++ b/config.go @@ -58,7 +58,7 @@ func newConfig(gitPath string) (*config, error) { } } else { out, err := cfg.gitconfig.Get(configReleaseBranch) - if err != nil { + if err == nil { cfg.releaseBranch = &configValue{ value: out, source: srcConfigFile, @@ -73,7 +73,7 @@ func newConfig(gitPath string) (*config, error) { } } else { out, err := cfg.gitconfig.Get(configVersionFile) - if err != nil { + if err == nil { cfg.releaseBranch = &configValue{ value: out, source: srcConfigFile, @@ -89,7 +89,7 @@ func newConfig(gitPath string) (*config, error) { cfg.vPrefix = github.Bool(b) } else { b, err := cfg.gitconfig.Bool(configVPrefix) - if err != nil { + if err == nil { cfg.vPrefix = github.Bool(b) } } diff --git a/rcpr.go b/rcpr.go index 7d0ff6f..09fabb4 100644 --- a/rcpr.go +++ b/rcpr.go @@ -139,7 +139,9 @@ func Run(ctx context.Context, argv []string, outStream, errStream io.Writer) err } if rp.cfg.vPrefix == nil { - rp.cfg.SetVPrefix(currVer.vPrefix) + if err := rp.cfg.SetVPrefix(currVer.vPrefix); err != nil { + return err + } } else { currVer.vPrefix = *rp.cfg.vPrefix }