Skip to content

Commit

Permalink
Added default server in config resolves #4
Browse files Browse the repository at this point in the history
  • Loading branch information
tympanix committed Aug 28, 2016
1 parent c2e747c commit 5b597ea
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 7 deletions.
10 changes: 5 additions & 5 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ const {app} = electron;
const {BrowserWindow} = electron;
const {ipcMain} = electron;

// Custom modules
const config = require('./lib/config');
const updater = require('./lib/update');
const logger = require('./lib/logger');

// Set up program arguments
yargs.version(() => { return app.getVersion() })
yargs.help('h').alias('h', 'help')
yargs.usage(`Electorrent ${app.getVersion()}`)
yargs.boolean('v').alias('v', 'verbose').describe('v', 'Enable verbose logging')
yargs.boolean('d').alias('d', 'debug').describe('d', 'Start in debug mode')

// Custom modules
const config = require('./lib/config');
const updater = require('./lib/update');
const logger = require('./lib/logger');

// Log startup information
logger.debug('Starting Electorrent in debug mode');
logger.verbose('Verbose logging enabled');
Expand Down
3 changes: 3 additions & 0 deletions lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ const {app} = require('electron');
var data = null;

var defaultSettings = {
server: {

},
ui: {
resizeMode: 'FixedResizer'
}
Expand Down
6 changes: 4 additions & 2 deletions lib/logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
const electron = require('electron');
const winston = require('winston');
const path = require('path');
const program = require('yargs').argv;
const program = require('yargs').parse(process.argv);

const {app} = electron;

Expand All @@ -16,6 +16,8 @@ const logger = new (winston.Logger)({
]
});

logger.error("Program", program);

function getLogLevel() {
if (program.debug){
return 'debug'
Expand All @@ -26,4 +28,4 @@ function getLogLevel() {
}
}

module.exports = logger;
module.exports = logger;
6 changes: 6 additions & 0 deletions lib/update.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,12 @@ function notifyConnectionError() {
}

function squirrelUpdater() {

if (!is.windows()) {
logger.verbose('Squirrel skip initialization on non-windows platforms')
return;
}

try {
// Set the URL to the release server
autoUpdater.setFeedURL(updateUrl);
Expand Down

0 comments on commit 5b597ea

Please sign in to comment.