20 lines
439 B
Go
20 lines
439 B
Go
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 {
|
|
return fmt.Errorf("destination bundle path %q is not empty after managed cleanup", storage.DisplayPath(bundlePath))
|
|
}
|
|
return nil
|
|
}
|