mirror of
https://github.com/cupcakearmy/autorestic.git
synced 2025-12-09 22:04:59 +00:00
check config bugs
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user