@engine9-io/input-tools 1.9.6 → 1.9.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/file/FileUtilities.js +8 -1
- package/package.json +1 -1
package/file/FileUtilities.js
CHANGED
|
@@ -874,7 +874,14 @@ Worker.prototype.move = async function ({ filename, target, remove = true }) {
|
|
|
874
874
|
}
|
|
875
875
|
await fsp.mkdir(path.dirname(target), { recursive: true });
|
|
876
876
|
if (remove) {
|
|
877
|
-
|
|
877
|
+
try {
|
|
878
|
+
await fsp.rename(filename, target);
|
|
879
|
+
} catch (e) {
|
|
880
|
+
//it may be a filesystem issue moving between items
|
|
881
|
+
debug(e);
|
|
882
|
+
await fsp.copyFile(filename, target);
|
|
883
|
+
await fsp.unlink(filename);
|
|
884
|
+
}
|
|
878
885
|
} else {
|
|
879
886
|
await fsp.copyFile(filename, target);
|
|
880
887
|
}
|