From 2f407cf2110c8ffaacf128832d1b5882e1babdc1 Mon Sep 17 00:00:00 2001 From: Romain de Laage Date: Wed, 24 Aug 2022 12:09:32 +0200 Subject: [PATCH] Add forget for copy backend (#223) fix #221 --- internal/location.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/internal/location.go b/internal/location.go index fe047b7..5dae649 100644 --- a/internal/location.go +++ b/internal/location.go @@ -320,7 +320,12 @@ after: func (l Location) Forget(prune bool, dry bool) error { colors.PrimaryPrint("Forgetting for location \"%s\"", l.name) - for _, to := range l.To { + backendsToForget := l.To + for _, copyBackends := range l.CopyOption { + backendsToForget = append(backendsToForget, copyBackends...) + } + + for _, to := range backendsToForget { backend, _ := GetBackend(to) colors.Secondary.Printf("For backend \"%s\"\n", backend.name) env, err := backend.getEnv()