Browse Source

Merge pull request #132 from sobaarcier/feature/portable

Add portable option (data folder in Hamsket folder)
pull/3202/head
TheGoddessInari 5 years ago committed by GitHub
parent
commit
84ef78f7d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      electron/main.js

8
electron/main.js

@ -15,6 +15,14 @@ const updater = require('./updater');
const fs = require("fs");
const path = require('path');
// If 'data' folder exists in Hamsket's folder, set userdata, logs, and usercache path to there
var basepath = app.getAppPath();
if (fs.existsSync(path.join(basepath, 'data'))) {
app.setPath('userData', path.join(basepath, 'data', 'data'));
app.setPath('logs', path.join(basepath, 'data', 'logs'));
app.setPath('userCache', path.join(basepath, 'data', 'cache'));
}
// Initial Config
const config = new Config({
defaults: {

Loading…
Cancel
Save