Skip to content

Commit 95ffed0

Browse files
committed
Add changes.log additions to irc.log.
This allows for adding additional modifications to the `irc.log` file (modifying chairs, scribes, etc.) without altering the raw `irc.log` data.
1 parent 0c72d12 commit 95ffed0

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

index.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ if (!program.html && !program.email && !program.index) {
4949
// setup global variables
5050
const dstDir = path.resolve(path.join(program.directory));
5151
const logFile = path.resolve(dstDir, 'irc.log');
52+
const changesLogFile = path.resolve(dstDir, 'changes.log');
5253
const audioFile = path.resolve(dstDir, 'audio.ogg');
5354
const indexFile = path.resolve(dstDir, 'index.html');
5455
const minutesDir = path.join(dstDir, '/..');
@@ -130,7 +131,15 @@ async.waterfall([ function(callback) {
130131
});
131132
}, function(callback) {
132133
// read the IRC log file
133-
fs.readFile(logFile, 'utf8', callback);
134+
let log = fs.readFileSync(logFile, 'utf8');
135+
// read the changes log file if it exists
136+
try {
137+
log += '\n';
138+
log += fs.readFileSync(changesLogFile, 'utf8');
139+
} catch(e) {
140+
// ignore if the file doesn't exist
141+
}
142+
callback(null, log);
134143
}, function(data, callback) {
135144
gLogData = data;
136145
// generate the index.html file

0 commit comments

Comments
 (0)