Added logs to detect Files written with no content

This commit is contained in:
Luis Fernando Molina committed 2019-08-17 15:48:11 +02:00
1 parent 180f1cd746
commit bca06e177c
1 file changed
+3
+3
View File
@@ -64,6 +64,7 @@ exports.newFileStorage = function newFileStorage(logger) {
}
logInfo('getTextFile: ' + fileLocation)
console.log('getTextFile: ' + fileLocation)
let fileContent = await readFileAsync(fileLocation)
callBackFunction(global.DEFAULT_OK_RESPONSE, fileContent.toString())
@@ -129,6 +130,8 @@ exports.newFileStorage = function newFileStorage(logger) {
}
logInfo('createTextFile: ' + fileLocation)
console.log('createTextFile: ' + fileLocation)
let directoryPath = fileLocation.substring(0, fileLocation.lastIndexOf('/') + 1);
mkDirByPathSync(directoryPath)
await writeFileAsync(fileLocation, fileContent)