Skip to content
This repository has been archived by the owner on Feb 8, 2024. It is now read-only.

Commit

Permalink
Fixed a bug where fs was used before it was declared
Browse files Browse the repository at this point in the history
  • Loading branch information
natsukagami committed May 26, 2017
1 parent fc09ef1 commit ee3bda2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* Instead for session-based data we use LokiJS, and for contests and submit logs
* (yes we have submit logs) we have persistent NeDB for that.
*/
const fs = require('fs');
const compression = require('compression');
const express = require('express');
const bodyParser = require('body-parser');
Expand Down Expand Up @@ -152,7 +153,7 @@ if (process.env.NODE_ENV === 'production') {
.then(response => {
if (response.status !== 200) return httpServer.debug('Failed to check for new version: Response status ' + response.status);
const versions = response.data;
if (versions[0].tag_name !== require('fs').readFileSync('twi.version', 'utf-8')) {
if (versions[0].tag_name !== fs.readFileSync('twi.version', 'utf-8')) {
httpServer.debug('New version available: ' + versions[0].name + ', please download at ' + versions[0].assets[0].browser_download_url);
}
})
Expand Down

0 comments on commit ee3bda2

Please sign in to comment.