Fix moveOrCopyFileWithCollisions() for fse-extra with kludge
This commit is contained in:
parent
359f21914f
commit
ff3ab38a7a
|
@ -51,7 +51,7 @@ function moveOrCopyFileWithCollisionHandling(src, dst, operation, cb) {
|
||||||
if(err) {
|
if(err) {
|
||||||
// for some reason fs-extra copy doesn't pass err.code
|
// for some reason fs-extra copy doesn't pass err.code
|
||||||
// :TODO: this is dangerous: submit a PR to fs-extra to set EEXIST
|
// :TODO: this is dangerous: submit a PR to fs-extra to set EEXIST
|
||||||
if('EEXIST' === err.code || 'copy' === operation) {
|
if('EEXIST' === err.code || 'dest already exists.' === err.message) {
|
||||||
renameIndex += 1;
|
renameIndex += 1;
|
||||||
return cb(null); // keep trying
|
return cb(null); // keep trying
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue