mirror of
https://github.com/bitwarden/browser.git
synced 2024-11-23 11:56:00 +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 * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
|
||||
import { DesktopMainMessagingService } from './services/desktopMainMessaging.service';
|
||||
@ -41,7 +42,12 @@ export class Main {
|
||||
if (appDataPath != null) {
|
||||
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 watch = args.some((val) => val === '--watch');
|
||||
|
Loading…
Reference in New Issue
Block a user