aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal
diff options
context:
space:
mode:
Diffstat (limited to 'internal')
-rw-r--r--internal/pkg/pkg.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/internal/pkg/pkg.go b/internal/pkg/pkg.go
index 61ec511c..dd48d847 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
+ }
}
}