mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-13 22:27:13 +02:00
Update console log paths to be in OS app data directory
This commit is contained in:
parent
c8b40c2948
commit
d567c215bb
1 changed files with 10 additions and 2 deletions
|
@ -16,12 +16,22 @@ var Process = hfprocess.Process;
|
|||
var ProcessGroup = hfprocess.ProcessGroup;
|
||||
var ProcessGroupStates = hfprocess.ProcessGroupStates;
|
||||
|
||||
function getApplicationDataDirectory() {
|
||||
// Taken from http://stackoverflow.com/questions/19275776/node-js-how-to-get-the-os-platforms-user-data-folder
|
||||
var rootDirectory = process.env.APPDATA || (process.platform == 'darwin' ? process.env.HOME + 'Library/Preferences' : '/var/local')
|
||||
return path.join(rootDirectory, '/High Fidelity/Console');
|
||||
}
|
||||
|
||||
|
||||
const ipcMain = electron.ipcMain;
|
||||
|
||||
const osType = os.type();
|
||||
|
||||
var path = require('path');
|
||||
|
||||
var logPath = path.join(getApplicationDataDirectory(), '/logs');
|
||||
console.log("Log directory:", logPath);
|
||||
|
||||
const TRAY_FILENAME = (osType == "Darwin" ? "console-tray-Template.png" : "console-tray.png");
|
||||
const TRAY_ICON = path.join(__dirname, '../resources/' + TRAY_FILENAME);
|
||||
const APP_ICON = path.join(__dirname, '../resources/console.png');
|
||||
|
@ -186,8 +196,6 @@ app.on('ready', function() {
|
|||
app.dock.hide()
|
||||
}
|
||||
|
||||
var logPath = path.join(app.getAppPath(), 'logs');
|
||||
|
||||
// Create tray icon
|
||||
tray = new Tray(TRAY_ICON);
|
||||
tray.setToolTip('High Fidelity');
|
||||
|
|
Loading…
Reference in a new issue