Skip to content

Commit

Permalink
use localAppDataDir for data
Browse files Browse the repository at this point in the history
  • Loading branch information
greggman committed Dec 13, 2014
1 parent 7ffe1f3 commit bc8dcbb
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,18 @@ if (process.platform.substring(0, 3).toLowerCase() == "win") {
baseName = ".happyfuntimes";
}

var g_configPath = path.join(home.appDataDir, baseName, "config.json");
// This sucks. I used to put things in appDataDir not knowing that
// defaults to Roaming on Windows.. So, check if that exists. If
// it does use it. If not use the new path.
var getConfigPath = function() {
var p = path.join(home.appDataDir, baseName, "config.json");
if (fs.existsSync(p)) {
return p;
}
return path.join(home.localAppDataDir, baseName, "config.json");
};

var g_configPath = getConfigPath();
var g_configRead = false;
var g_settingsPath = path.join(__dirname, "..", "hft.hanson");
var g_settingsRead = false;
Expand Down

0 comments on commit bc8dcbb

Please sign in to comment.