From 73487046725fd7a3c788d0c96ed7e7de42eb92db Mon Sep 17 00:00:00 2001 From: xiaojunnuo Date: Sun, 15 Aug 2021 06:09:45 -0700 Subject: [PATCH] build: ubuntu build --- packages/core/src/config/index.js | 2 +- packages/core/src/shell/scripts/kill-by-port.js | 3 ++- packages/gui/src/background.js | 4 +++- packages/gui/vue.config.js | 9 ++++++++- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/packages/core/src/config/index.js b/packages/core/src/config/index.js index 26baaac9..457d8726 100644 --- a/packages/core/src/config/index.js +++ b/packages/core/src/config/index.js @@ -215,7 +215,7 @@ module.exports = { }, speedTest: { enabled: true, - interval: 160000, + interval: 60000, hostnameList: ['github.com'], dnsProviders: ['usa', 'quad9', 'rubyfish'] } diff --git a/packages/core/src/shell/scripts/kill-by-port.js b/packages/core/src/shell/scripts/kill-by-port.js index ba834ff2..2f321949 100644 --- a/packages/core/src/shell/scripts/kill-by-port.js +++ b/packages/core/src/shell/scripts/kill-by-port.js @@ -9,7 +9,8 @@ const executor = { return true }, async linux (exec, { port }) { - throw Error('暂未实现此功能') + await exec('kill `lsof -i:' + port + " |grep 'dev-sidecar\\|electron' |awk '{print $2}'`") + return true }, async mac (exec, { port }) { await exec('kill `lsof -i:' + port + " |grep 'DevSide\\|Elect' |awk '{print $2}'`") diff --git a/packages/gui/src/background.js b/packages/gui/src/background.js index 71ae4aca..d1958088 100644 --- a/packages/gui/src/background.js +++ b/packages/gui/src/background.js @@ -34,6 +34,7 @@ function setTray (app) { // 系统托盘图标目录 label: '退出', click: () => { + console.log('force quit') forceClose = true quit(app) } @@ -83,7 +84,7 @@ function isLinux () { function hideWin () { if (win) { if (isLinux()) { - win.minimize() + quit(app) } else { win.hide() } @@ -193,6 +194,7 @@ if (!isFirstInstance) { // Quit when all windows are closed. app.on('window-all-closed', () => { + console.log('window-all-closed') // On macOS it is common for applications and their menu bar // to stay active until the user quits explicitly with Cmd + Q if (process.platform !== 'darwin') { diff --git a/packages/gui/vue.config.js b/packages/gui/vue.config.js index 25aef364..6f20b26c 100644 --- a/packages/gui/vue.config.js +++ b/packages/gui/vue.config.js @@ -58,11 +58,18 @@ module.exports = { allowToChangeInstallationDirectory: true }, mac: { - icon: 'build/mac/icon.icns' + icon: './build/mac/icon.icns' }, win: { requestedExecutionLevel: 'requireAdministrator' }, + icon: './build/icons/512x512.png', + linux: { + icon: './build/icons/', + target: [ + 'AppImage' + ] + }, publish: { provider: 'generic', url: 'http://dev-sidecar.docmirror.cn/update/'