Fix for failed tests

This commit is contained in:
Yuya Ochiai
2015-12-23 19:25:14 +09:00
parent d010d09ef4
commit 62b6e4c51b
4 changed files with 40 additions and 11 deletions

View File

@@ -8,6 +8,7 @@ const Tray = electron.Tray;
const ipc = electron.ipcMain;
const fs = require('fs');
var settings = require('./common/settings');
var appMenu = require('./menus/app');
var argv = require('yargs').argv;
@@ -27,6 +28,18 @@ else {
global['config-file'] = app.getPath('userData') + '/config.json'
}
try {
var configFile = global['config-file'];
var config = settings.readFileSync(configFile);
if (config.version != settings.version) {
config = settings.upgrade(config);
settings.writeFileSync(configFile, config);
}
}
catch (e) {
console.log('Failed to read or upgrade config.json');
}
// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected.
var mainWindow = null;