Added duplicate remover ( #5 ), saving subjects without year, file append now sync, minor logging improvements

This commit is contained in:
MrFry 2020-03-26 14:33:52 +01:00
parent be34113969
commit e6db0f9175
4 changed files with 284 additions and 8 deletions

View file

@ -87,9 +87,13 @@ function WriteFileAsync (content, path) {
function AppendToFile (data, file) {
CreatePath(file)
fs.appendFile(file, '\n' + data, function (err) {
if (err) { logger.Log('Error writing log file: ' + file + ' (sync)', logger.GetColor('redbg')) }
})
try {
fs.appendFileSync(file, '\n' + data)
} catch (e) {
logger.Log('Error appendig to file log file: ' + file + ' (sync)', logger.GetColor('redbg'))
logger.Log(data)
console.log(e)
}
}
function Beep () {