From 6efde901d1b571d85c2f3e3a22790d98c676c61a Mon Sep 17 00:00:00 2001 From: Fletcher Date: Sun, 28 Apr 2019 14:43:25 -0400 Subject: [PATCH] Electron cache moved to AppName folder --- main.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main.js b/main.js index 02aebc9..94535fc 100644 --- a/main.js +++ b/main.js @@ -5,6 +5,7 @@ const {app, BrowserWindow, ipcMain, Menu, MenuItem, Tray, dialog, Notification} const consts = require('./src/consts.js') const client = require('./src/client.js').init() const rl = require('readline').createInterface({input: client.socket}) +const path = require('path') let callbacks = {}; let counters = {}; @@ -43,6 +44,9 @@ for (let i = idx; i < process.argv.length; i++) { app.commandLine.appendSwitch(s, v); } +// App Cache Path +app.setPath('userData', path.join(process.env.APPDATA || (process.platform == 'darwin' ? process.env.HOME + 'Library/Preferences' : process.env.HOME + "/.local/share"), process.argv[4] || "astilectron")); + // App is quitting app.on('before-quit', () => quittingApp = true);