mirror of
https://github.com/bitwarden/desktop.git
synced 2025-02-18 01:31:42 +01:00
create logs dir if not exists
This commit is contained in:
parent
b41e3f9398
commit
fbf6660872
@ -1,4 +1,5 @@
|
|||||||
import { app, BrowserWindow } from 'electron';
|
import { app, BrowserWindow } from 'electron';
|
||||||
|
import * as fs from 'fs';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
|
|
||||||
import { DesktopMainMessagingService } from './services/desktopMainMessaging.service';
|
import { DesktopMainMessagingService } from './services/desktopMainMessaging.service';
|
||||||
@ -41,7 +42,12 @@ export class Main {
|
|||||||
if (appDataPath != null) {
|
if (appDataPath != null) {
|
||||||
app.setPath('userData', appDataPath);
|
app.setPath('userData', appDataPath);
|
||||||
}
|
}
|
||||||
app.setPath('logs', path.join(app.getPath('userData'), 'logs'));
|
|
||||||
|
const logsDir = path.join(app.getPath('userData'), 'logs');
|
||||||
|
if (!fs.existsSync(logsDir)) {
|
||||||
|
fs.mkdirSync(logsDir);
|
||||||
|
}
|
||||||
|
app.setPath('logs', logsDir);
|
||||||
|
|
||||||
const args = process.argv.slice(1);
|
const args = process.argv.slice(1);
|
||||||
const watch = args.some((val) => val === '--watch');
|
const watch = args.some((val) => val === '--watch');
|
||||||
|
Loading…
Reference in New Issue
Block a user