1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
Description: Clobber a Link if it's in the way of a File
Author: isaacs <i@izs.me>
Origin: upstream, https://github.com/npm/fstream/commit/6a77d2f
Bug: https://www.npmjs.com/advisories/886
Bug-Debian: https://bugs.debian.org/931408
Forwarded: not-needed
Reviewed-By: Xavier Guimard <yadd@debian.org>
Last-Update: 2019-08-28
--- a/lib/writer.js
+++ b/lib/writer.js
@@ -147,7 +147,7 @@
// if it's a type change, then we need to clobber or error.
// if it's not a type change, then let the impl take care of it.
- if (currentType !== self.type) {
+ if (currentType !== self.type || self.type === 'File' && current.nlink > 1) {
return rimraf(self._path, function (er) {
if (er) return self.error(er)
self._old = null
|