mirror of
https://github.com/finos/SymphonyElectron.git
synced 2024-12-28 09:51:06 -06:00
Crash dump files location fix on Windows
This commit is contained in:
parent
26ee577386
commit
c6fa5f6040
@ -4,7 +4,7 @@ import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
|
||||
import { ILogs } from '../common/api-interface';
|
||||
import { isLinux, isMac } from '../common/env';
|
||||
import { isLinux, isMac, isWindowsOS } from '../common/env';
|
||||
import { i18n } from '../common/i18n';
|
||||
import { logger } from '../common/logger';
|
||||
|
||||
@ -179,10 +179,8 @@ export const exportLogs = (): void => {
|
||||
*/
|
||||
export const exportCrashDumps = (): void => {
|
||||
const FILE_EXTENSIONS = isMac ? ['.dmp'] : ['.dmp', '.txt'];
|
||||
const crashesDirectory = app.getPath('crashDumps');
|
||||
const source = isMac ? crashesDirectory + '/completed' : crashesDirectory;
|
||||
const source = getCrashesDirectory();
|
||||
const focusedWindow = BrowserWindow.getFocusedWindow();
|
||||
|
||||
if (
|
||||
!fs.existsSync(source) ||
|
||||
(fs.readdirSync(source).length === 0 &&
|
||||
@ -219,3 +217,14 @@ export const exportCrashDumps = (): void => {
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const getCrashesDirectory = (): string => {
|
||||
const crashesDirectory = app.getPath('crashDumps');
|
||||
let source = crashesDirectory;
|
||||
if (isMac) {
|
||||
source += '/completed';
|
||||
} else if (isWindowsOS) {
|
||||
source += '\\reports';
|
||||
}
|
||||
return source;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user