Skip to content
This repository has been archived by the owner on Aug 3, 2022. It is now read-only.

Commit

Permalink
Move _dataPath assignment to init function to fix invalid path errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Jiiks committed Nov 2, 2015
1 parent 8f37203 commit 713c112
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions lib/BetterDiscord.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@
* Last Update: 25/10/2015 - 23:48
* https://github.com/Jiiks/BetterDiscordApp
*/

//Imports
var _fs = require("fs");
var _config = require("./config.json");
var _utils = require("./utils");
var _ipc = require('ipc');

//Use beta javascript
//Beta flag
var _beta = false;

var _ipc = require('ipc');

var _version;
var _mainWindow;
var _updater;
Expand All @@ -25,15 +26,10 @@ var _cacheExpired = false;
var _cacheDays = 0;
var _dataPath;

// OS specific _dataPath

var _os = process.platform;
if (_os == "win32") {
_dataPath = "../BetterDiscordData";
} else if (_os == "darwin") {
_dataPath = "~/Library/Application Support/discord/BetterDiscordData";
}
var _userfile;

var _userFile = _dataPath + "/user.json";

function BetterDiscord(mainWindow) {
_mainWindow = mainWindow;
Expand All @@ -47,6 +43,15 @@ BetterDiscord.prototype.getUtils = function() {

BetterDiscord.prototype.init = function() {

//OS specific _dataPath
if (_os == "win32") {
_dataPath = "../BetterDiscordData";
} else if (_os == "darwin") {
_dataPath = "~/Library/Application Support/discord/BetterDiscordData";
}
_userFile = _dataPath + "/user.json";


var self = this;

//Check emotedata cache
Expand Down

0 comments on commit 713c112

Please sign in to comment.