Isolate invocation collaborator composition
This commit is contained in:
@@ -12,9 +12,14 @@ import (
|
||||
"gitea.maximumdirect.net/eric/narratio/internal/manifest"
|
||||
)
|
||||
|
||||
var removeRunScopedDirFn = removeRunScopedDir
|
||||
|
||||
func runPostPublishCleanup(ctx context.Context, env *Env, manifestPath string, m *manifest.Manifest, executed []string) error {
|
||||
func runPostPublishCleanup(
|
||||
ctx context.Context,
|
||||
env *Env,
|
||||
manifestPath string,
|
||||
m *manifest.Manifest,
|
||||
executed []string,
|
||||
removeScopedDir func(root, target, policy string) error,
|
||||
) error {
|
||||
if env == nil || env.Config == nil || env.Config.Pipeline == nil || m == nil {
|
||||
return nil
|
||||
}
|
||||
@@ -40,7 +45,7 @@ func runPostPublishCleanup(ctx context.Context, env *Env, manifestPath string, m
|
||||
if target.Completed {
|
||||
continue
|
||||
}
|
||||
if err := removeRunScopedDirFn(target.Root, target.Path, target.Policy); err != nil {
|
||||
if err := removeScopedDir(target.Root, target.Path, target.Policy); err != nil {
|
||||
return fmt.Errorf("complete post-publish cleanup for %q: %w", target.Path, err)
|
||||
}
|
||||
target.Completed = true
|
||||
|
||||
Reference in New Issue
Block a user