Skip to content

Instantly share code, notes, and snippets.

@isaacs
Created April 23, 2019 19:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save isaacs/1e9a9f29ad232c88402455119fac59bc to your computer and use it in GitHub Desktop.
Save isaacs/1e9a9f29ad232c88402455119fac59bc to your computer and use it in GitHub Desktop.
diff --git a/lib/writer.js b/lib/writer.js
index 140e449..3f10547 100644
--- a/lib/writer.js
+++ b/lib/writer.js
@@ -147,7 +147,7 @@ Writer.prototype._stat = function (current) {
// 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment