Skip to content

Commit

Permalink
Making it 3.0.*-proof by only checking files with the format /Journal…
Browse files Browse the repository at this point in the history
…\.\d+\.\d+\.log/gi
  • Loading branch information
itssimple committed May 15, 2018
1 parent 64ee5bb commit db8ddef
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions edj.filereader.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,11 @@ edj = {
const _fileCount = _files.length;
let i = 0;
while (i < _fileCount) {
if (edj.lastFile === null || _files[i].lastModified > edj.lastFile.lastModified) {
edj.lastFile = _files[i];
if (_files[i].name.match(/Journal\.\d+\.\d+\.log/gi)) {
if (edj.lastFile === null || _files[i].lastModified > edj.lastFile.lastModified) {
edj.lastFile = _files[i];
}
}

i++;
}
const fr = new FileReader();
Expand All @@ -50,10 +51,11 @@ edj = {
const _fileCount = _files.length;
let i = 0;
while (i < _fileCount) {
if (edj.lastFile === null || _files[i] !== edj.lastFile) {
edj.lastFile = _files[i];
if (_files[i].match(/Journal\.\d+\.\d+\.log/gi)) {
if (edj.lastFile === null || _files[i] !== edj.lastFile) {
edj.lastFile = _files[i];
}
}

i++;
}
const fs = require('fs');
Expand All @@ -74,10 +76,6 @@ edj = {
const lines = fileContent.split('\n');
let l = edj.lastLine;
while (l < lines.length) {
/*if (lines[l] == '') {
l--;
break;
}*/
if (edj.lastLine !== lines[l]) {
edjLogparser.parseLogLine(lines[l]);
}
Expand Down

0 comments on commit db8ddef

Please sign in to comment.