Files

20 lines
439 B
Go
Raw Permalink Normal View History

2026-05-31 02:21:36 +00:00
package publish
import (
"context"
"fmt"
"gitea.maximumdirect.net/eric/distributor/internal/storage"
)
func ensureDestinationEmpty(ctx context.Context, backend storage.Backend, bundlePath string) error {
hasAny, err := backend.HasAny(ctx, bundlePath)
if err != nil {
return err
}
if hasAny {
2026-05-31 03:41:56 +00:00
return fmt.Errorf("destination bundle path %q is not empty after managed cleanup", storage.DisplayPath(bundlePath))
2026-05-31 02:21:36 +00:00
}
return nil
}