mirror of
https://github.com/zulip/zulip-desktop.git
synced 2025-11-03 13:33:18 +00:00
test: Create logs dir on app startup.
This commit is contained in:
@@ -11,9 +11,6 @@ if (process.type === 'renderer') {
|
|||||||
|
|
||||||
const browserConsole = console;
|
const browserConsole = console;
|
||||||
const logDir = `${app.getPath('userData')}/Logs`;
|
const logDir = `${app.getPath('userData')}/Logs`;
|
||||||
if (!fs.existsSync(logDir)) {
|
|
||||||
fs.mkdirSync(logDir);
|
|
||||||
}
|
|
||||||
|
|
||||||
function customConsole(opts, type, ...args) {
|
function customConsole(opts, type, ...args) {
|
||||||
const { nodeConsole, timestamp } = opts;
|
const { nodeConsole, timestamp } = opts;
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ const WebView = require(__dirname + '/js/components/webview.js');
|
|||||||
const ServerTab = require(__dirname + '/js/components/server-tab.js');
|
const ServerTab = require(__dirname + '/js/components/server-tab.js');
|
||||||
const FunctionalTab = require(__dirname + '/js/components/functional-tab.js');
|
const FunctionalTab = require(__dirname + '/js/components/functional-tab.js');
|
||||||
const ConfigUtil = require(__dirname + '/js/utils/config-util.js');
|
const ConfigUtil = require(__dirname + '/js/utils/config-util.js');
|
||||||
|
const initSetUp = require(__dirname + '/js/utils/default-util.js');
|
||||||
|
|
||||||
class ServerManagerView {
|
class ServerManagerView {
|
||||||
constructor() {
|
constructor() {
|
||||||
@@ -44,6 +45,7 @@ class ServerManagerView {
|
|||||||
this.initActions();
|
this.initActions();
|
||||||
this.registerIpcs();
|
this.registerIpcs();
|
||||||
this.initDefaultSettings();
|
this.initDefaultSettings();
|
||||||
|
initSetUp();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
14
app/renderer/js/utils/default-util.js
Normal file
14
app/renderer/js/utils/default-util.js
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
const fs = require('fs');
|
||||||
|
const { app } = require('electron').remote;
|
||||||
|
|
||||||
|
const logDir = `${app.getPath('userData')}/Logs/`;
|
||||||
|
|
||||||
|
const initSetUp = () => {
|
||||||
|
if (!fs.existsSync(logDir)) {
|
||||||
|
fs.mkdirSync(logDir);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
initSetUp
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user