0
0
Fork 0

Remove filetype from the names of the hibernated games.

This commit is contained in:
Oliver-Akins 2021-01-07 12:38:08 -07:00
parent 5666a507c8
commit 9268958a2f

View file

@ -38,10 +38,12 @@ if (Validate.config(conf)) {
// Add event listeners if we want to use the datastore saving game system // Add event listeners if we want to use the datastore saving game system
if (conf.datastores.enabled) { if (conf.datastores.enabled) {
log.info(`Loading list of hibernated games`);
// Get game IDs from datastore // Get game IDs from datastore
hibernatedGames = readdirSync(conf.datastores.directory) hibernatedGames = readdirSync(conf.datastores.directory)
.filter(g => g.endsWith(conf.datastores.filetype)); .filter(g => g.endsWith(conf.datastores.filetype))
.map(f => f.replace(`\.${conf.datastores.filetype}`, ``));
process.on(`uncaughtException`, processExit); process.on(`uncaughtException`, processExit);
process.on(`SIGINT`, processExit); process.on(`SIGINT`, processExit);