diff --git a/internal/pkg/pkg.go b/internal/pkg/pkg.go index 61ec511..dd48d84 100644 --- a/internal/pkg/pkg.go +++ b/internal/pkg/pkg.go @@ -163,8 +163,12 @@ func (t *TContext) destroy(errP *error) { if chmodErr != nil || removeErr != nil { *errP = errors.Join(*errP, chmodErr, removeErr) } else if errors.Is(*errP, os.ErrExist) { - // two artifacts may be backed by the same file - *errP = nil + var linkError *os.LinkError + if errors.As(*errP, &linkError) && linkError != nil && + linkError.Op == "rename" { + // two artifacts may be backed by the same file + *errP = nil + } } }