Fix deprecated write() without callback for Node.js 10.x+

This commit is contained in:
Bryan Ashby 2018-11-04 21:09:27 -07:00
parent 75c952c976
commit 8942eff203
1 changed files with 7 additions and 3 deletions

View File

@ -314,11 +314,15 @@ exports.getModule = class TransferFileModule extends MenuModule {
return callback(err); // failed to create it return callback(err); // failed to create it
} }
fs.write(tempFileInfo.fd, filePaths.join(SYSTEM_EOL)); fs.write(tempFileInfo.fd, filePaths.join(SYSTEM_EOL), err => {
if(err) {
return callback(err);
}
fs.close(tempFileInfo.fd, err => { fs.close(tempFileInfo.fd, err => {
return callback(err, tempFileInfo.path); return callback(err, tempFileInfo.path);
}); });
}); });
});
}, },
function createArgs(tempFileListPath, callback) { function createArgs(tempFileListPath, callback) {
// initial args: ignore {filePaths} as we must break that into it's own sep array items // initial args: ignore {filePaths} as we must break that into it's own sep array items