fix: don't fail if the file already exists (Windows Reflinks) (#7555)

close #7554
This commit is contained in:
Nacho Aldama
2024-01-27 14:44:37 +01:00
committed by GitHub
parent 0ec0a44da7
commit e146c258a8
2 changed files with 7 additions and 1 deletions

View File

@@ -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).

View File

@@ -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
}
}
}