From 048a5ffed8e321a9dfe6cd5eeba28b2caf57d34e Mon Sep 17 00:00:00 2001 From: cupcakearmy Date: Mon, 25 Oct 2021 18:02:45 +0200 Subject: [PATCH] renamed env --- internal/backend.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/backend.go b/internal/backend.go index a091357..8116d44 100644 --- a/internal/backend.go +++ b/internal/backend.go @@ -89,7 +89,8 @@ func (b Backend) getKey() (string, error) { if b.Key != "" { return b.Key, nil } - if key, found := os.LookupEnv("AUTORESTIC_KEY_" + strings.ToUpper(b.name)); found { + keyName := "AUTORESTIC_" + strings.ToUpper(b.name) + "_KEY" + if key, found := os.LookupEnv(keyName); found { return key, nil } return "", fmt.Errorf("no key found for backend \"%s\"", b.name)