Follow symlinks in app/config paths before starting app up

This commit is contained in:
Scott Nonnenberg 2018-06-14 13:39:44 -07:00
parent 5fca44d1b1
commit d5ead799ce

10
main.js
View file

@ -1,10 +1,14 @@
const path = require('path'); const path = require('path');
const url = require('url'); const url = require('url');
const os = require('os'); const os = require('os');
const fs = require('fs');
const _ = require('lodash'); const _ = require('lodash');
const pify = require('pify');
const electron = require('electron'); const electron = require('electron');
const getRealPath = pify(fs.realpath);
const { const {
app, app,
BrowserWindow, BrowserWindow,
@ -440,9 +444,9 @@ function showAbout() {
// initialization and is ready to create browser windows. // initialization and is ready to create browser windows.
// Some APIs can only be used after this event occurs. // Some APIs can only be used after this event occurs.
let ready = false; let ready = false;
app.on('ready', () => { app.on('ready', async () => {
const userDataPath = app.getPath('userData'); const userDataPath = await getRealPath(app.getPath('userData'));
const installPath = app.getAppPath(); const installPath = await getRealPath(app.getAppPath());
if (process.env.NODE_ENV !== 'test' && process.env.NODE_ENV !== 'test-lib') { if (process.env.NODE_ENV !== 'test' && process.env.NODE_ENV !== 'test-lib') {
installFileHandler({ installFileHandler({