Skip to content

Commit

Permalink
fix: don't fail if the file already exists (Windows Reflinks) (#7555)
Browse files Browse the repository at this point in the history
close #7554
  • Loading branch information
nachoaldamav committed Jan 27, 2024
1 parent 0ec0a44 commit e146c25
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .changeset/tough-hounds-laugh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@pnpm/fs.indexed-pkg-importer": patch
"pnpm": patch
---

Don't fail in Windows CoW if the file already exists [#7554](https://github.com/pnpm/pnpm/issues/7554).
2 changes: 1 addition & 1 deletion fs/indexed-pkg-importer/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ function createCloneFunction (): CloneFunction {
// If the file already exists, then we just proceed.
// This will probably only happen if the package's index file contains the same file twice.
// For instance: { "index.js": "hash", "./index.js": "hash" }
if (!err.message.startsWith('File exists')) throw err
if (!err.message.startsWith('File exists') && !err.message.includes('-2147024816')) throw err
}
}
}
Expand Down

0 comments on commit e146c25

Please sign in to comment.