'use strict';

var _ = require('underscore');
var l = require('winston').loggers.get('default');

var getUserConfig = function() {
  var userConfig = {};

  try {
    userConfig = require(process.env.HOME + '/.youpower.json');
  } catch (e) {
    l.warn('could not find user config, using defaults');
  }

  return userConfig;
};

var defaultConfig = {
  civisURL: 'http://civis.cloud.reply.eu/Civis/EnergyPlatform.svc'
};

module.exports = _.defaults(getUserConfig(), defaultConfig);

@@ -89,16 +89,44 @@
 fault');
+%0Avar path = require('path');
 %0A%0Avar ge
@@ -184,16 +184,101 @@
   try %7B%0A
+    var home = process.env%5B(process.platform === 'win32') ? 'USERPROFILE' : 'HOME'%5D;%0A
     user
@@ -299,28 +299,24 @@
 re(p
-rocess.env.HOME +
+ath.join(home,
  '
-/
 .you
@@ -324,15 +324,26 @@
 ower
+', 'config
 .json')
+)
 ;%0A  

make config.js platform-agnostic