From a4b54f9f64cd9ae5b8c7c1d615d041bd7fe1f08f Mon Sep 17 00:00:00 2001 From: cupcakearmy Date: Sun, 11 Jul 2021 13:51:04 +0200 Subject: [PATCH] check config bugs --- CHANGELOG.md | 6 ++++++ cmd/exec.go | 2 +- cmd/forget.go | 2 +- internal/config.go | 4 ++-- internal/location.go | 2 +- 5 files changed, 11 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c7b666..4925b0c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/cmd/exec.go b/cmd/exec.go index 29b72e9..6b3fa67 100644 --- a/cmd/exec.go +++ b/cmd/exec.go @@ -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) diff --git a/cmd/forget.go b/cmd/forget.go index 2034c0f..7010ff0 100644 --- a/cmd/forget.go +++ b/cmd/forget.go @@ -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) diff --git a/internal/config.go b/internal/config.go index 3e74bf9..f4d4583 100644 --- a/internal/config.go +++ b/internal/config.go @@ -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 } } diff --git a/internal/location.go b/internal/location.go index ab8c4f3..01c95c6 100644 --- a/internal/location.go +++ b/internal/location.go @@ -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) }