Add local source publication
This commit is contained in:
19
internal/publish/safety.go
Normal file
19
internal/publish/safety.go
Normal file
@@ -0,0 +1,19 @@
|
||||
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", displayPath(bundlePath))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
Reference in New Issue
Block a user