mirror of
https://github.com/pnpm/pnpm.git
synced 2025-12-23 23:29:17 -05:00
6
.changeset/fruity-lands-laugh.md
Normal file
6
.changeset/fruity-lands-laugh.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"@pnpm/fs.hard-link-dir": patch
|
||||
"pnpm": patch
|
||||
---
|
||||
|
||||
Don't crash when two processes of pnpm are hardlinking the contents of a directory to the same destination simultaneously [#10179](https://github.com/pnpm/pnpm/issues/10179).
|
||||
@@ -5,7 +5,7 @@ import fs from 'fs'
|
||||
import { globalWarn } from '@pnpm/logger'
|
||||
import gfs from '@pnpm/graceful-fs'
|
||||
import { sync as renameOverwrite } from 'rename-overwrite'
|
||||
import { fastPathTemp as pathTemp } from 'path-temp'
|
||||
import pathTemp from 'path-temp'
|
||||
|
||||
export function hardLinkDir (src: string, destDirs: string[]): void {
|
||||
if (destDirs.length === 0) return
|
||||
@@ -17,7 +17,7 @@ export function hardLinkDir (src: string, destDirs: string[]): void {
|
||||
continue
|
||||
}
|
||||
filteredDestDirs.push(destDir)
|
||||
tempDestDirs.push(pathTemp(destDir))
|
||||
tempDestDirs.push(pathTemp(path.dirname(destDir)))
|
||||
}
|
||||
_hardLinkDir(src, tempDestDirs, true)
|
||||
for (let i = 0; i < filteredDestDirs.length; i++) {
|
||||
|
||||
Reference in New Issue
Block a user