From a80c680914d3dcdd5cec33571426f87a17d788fc Mon Sep 17 00:00:00 2001 From: Jan Prochazka Date: Fri, 8 Jan 2021 21:03:51 +0100 Subject: [PATCH] simplified linux icon --- app/src/electron.js | 17 +---------------- packages/api/src/utility/directories.js | 6 +----- 2 files changed, 2 insertions(+), 21 deletions(-) diff --git a/app/src/electron.js b/app/src/electron.js index 9b28d3a2..84db55d8 100644 --- a/app/src/electron.js +++ b/app/src/electron.js @@ -1,6 +1,5 @@ const electron = require('electron'); const os = require('os'); -const fs = require('fs'); const { Menu } = require('electron'); const { fork } = require('child_process'); const { autoUpdater } = require('electron-updater'); @@ -25,18 +24,6 @@ let splashWindow; log.transports.file.level = 'debug'; autoUpdater.logger = log; -function datadir() { - const dir = path.join(os.homedir(), 'dbgate-data'); - if (!fs.existsSync(dir)) { - try { - fs.mkdirSync(dir); - } catch (err) { - console.error(`Error creating ${dir} directory`, err); - } - } - return dir; -} - function hideSplash() { if (splashWindow) { splashWindow.destroy(); @@ -164,9 +151,7 @@ function createWindow() { }); mainWindow.loadURL(startUrl); if (os.platform() == 'linux') { - const iconFile = path.join(datadir(), 'dbgate-icon.png'); - fs.copyFileSync(path.resolve(__dirname, '../icon.png'), iconFile); - mainWindow.setIcon(iconFile); + mainWindow.setIcon(path.resolve(__dirname, '../icon.png')); } } diff --git a/packages/api/src/utility/directories.js b/packages/api/src/utility/directories.js index aaffc88c..f1c41ac5 100644 --- a/packages/api/src/utility/directories.js +++ b/packages/api/src/utility/directories.js @@ -12,11 +12,7 @@ const ensureDirectory = (dir, clean) => { } if (!fs.existsSync(dir)) { console.log(`Creating directory ${dir}`); - try { - fs.mkdirSync(dir); - } catch (err) { - console.error(`Error creating ${dir} directory`, err); - } + fs.mkdirSync(dir); } createDirectories[dir] = true; }