|
|
|
|
@ -177,10 +177,12 @@ const { page_ids, output, events: event_file } = parse_args(
|
|
|
|
|
|
|
|
|
|
const read_previous_events = (path) => { |
|
|
|
|
if (path !== null) { |
|
|
|
|
return fs |
|
|
|
|
.readFile(path, { encoding: 'utf-8' }) |
|
|
|
|
.then((content) => JSON.parse(content)) |
|
|
|
|
.catch(console.error); |
|
|
|
|
if (filesystem.existsSync(path)) { |
|
|
|
|
return fs |
|
|
|
|
.readFile(path, { encoding: 'utf-8' }) |
|
|
|
|
.then((content) => JSON.parse(content)) |
|
|
|
|
.catch(console.error); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return Promise.resolve([]); |
|
|
|
|
}; |
|
|
|
|
|