mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-03-09 15:40:18 +00:00
Fixed EXDEV error on rename.
This commit is contained in:
parent
487b631607
commit
a466c2fed1
3 changed files with 28 additions and 8 deletions
10
common.js
10
common.js
|
@ -258,4 +258,14 @@ module.exports.translationsToJson = function(t) {
|
|||
}
|
||||
arr2.sort(function (a, b) { if (a.en > b.en) return 1; if (a.en < b.en) return -1; return 0; });
|
||||
return JSON.stringify({ strings: arr2 }, null, ' ');
|
||||
}
|
||||
|
||||
module.exports.copyFile = function(source, target, cb) {
|
||||
var cbCalled = false, rd = fs.createReadStream(source);
|
||||
rd.on('error', function (err) { done(err); });
|
||||
var wr = fs.createWriteStream(target);
|
||||
wr.on('error', function (err) { done(err); });
|
||||
wr.on('close', function (ex) { done(); });
|
||||
rd.pipe(wr);
|
||||
function done(err) { if (!cbCalled) { cb(err); cbCalled = true; } }
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue