Add forget for copy backend (#223)

fix #221
This commit is contained in:
Romain de Laage 2022-08-24 12:09:32 +02:00 committed by GitHub
parent 489f3078fe
commit 2f407cf211
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -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()