check config bugs

pull/103/head v1.1.2
cupcakearmy 4 years ago
parent c2e88193cd
commit a4b54f9f64
No known key found for this signature in database
GPG Key ID: D28129AE5654D9D9

@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [1.1.2] - 2021-07-11
### Fixes
Don't check all backend when running `forget` or `exec` commands.
## [1.1.1] - 2021-05-17
### Added

@ -15,7 +15,7 @@ var execCmd = &cobra.Command{
CheckErr(err)
defer lock.Unlock()
CheckErr(internal.CheckConfig())
internal.GetConfig()
selected, err := internal.GetAllOrSelected(cmd, true)
CheckErr(err)

@ -14,7 +14,7 @@ var forgetCmd = &cobra.Command{
CheckErr(err)
defer lock.Unlock()
CheckErr(internal.CheckConfig())
internal.GetConfig()
selected, err := internal.GetAllOrSelected(cmd, false)
CheckErr(err)

@ -12,7 +12,7 @@ import (
"github.com/spf13/viper"
)
const VERSION = "1.1.1"
const VERSION = "1.1.2"
var CI bool = false
var VERBOSE bool = false
@ -140,7 +140,7 @@ func CheckConfig() error {
}
for name, location := range c.Locations {
location.name = name
if err := location.validate(c); err != nil {
if err := location.validate(); err != nil {
return err
}
}

@ -47,7 +47,7 @@ func GetLocation(name string) (Location, bool) {
return l, ok
}
func (l Location) validate(c *Config) error {
func (l Location) validate() error {
if l.From == "" {
return fmt.Errorf(`Location "%s" is missing "from" key`, l.name)
}

Loading…
Cancel
Save