From 5c56915fa748903f9bd7753cd25ece279d7bf54e Mon Sep 17 00:00:00 2001
From: AkiraFukushima
Date: Wed, 18 Sep 2019 01:08:36 +0900
Subject: [PATCH 1/2] Add build command for mas in Makefile
---
Makefile | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/Makefile b/Makefile
index a048714e..74d00466 100644
--- a/Makefile
+++ b/Makefile
@@ -14,6 +14,10 @@ mac:
npm run package:mac
mv build/Whalebird-${VERSION}-mac.dmg build/Whalebird-${VERSION}-darwin-x64.dmg
+mas:
+ npm run build:mas
+ ./appStore.sh
+
linux:
npm run package:linux
mv build/Whalebird-${VERSION}-linux-amd64.deb build/Whalebird-${VERSION}-linux-x64.deb
From 44c5c7ee3a048d0277796a823d7301d0fa460701 Mon Sep 17 00:00:00 2001
From: AkiraFukushima
Date: Wed, 18 Sep 2019 01:13:16 +0900
Subject: [PATCH 2/2] refs #1030 Do not enforce single instance in darwin
---
src/main/index.ts | 35 ++++++++++++++++++++---------------
1 file changed, 20 insertions(+), 15 deletions(-)
diff --git a/src/main/index.ts b/src/main/index.ts
index 89d2589c..060bcd37 100644
--- a/src/main/index.ts
+++ b/src/main/index.ts
@@ -74,23 +74,28 @@ let mainWindow: BrowserWindow | null
let tray: Tray | null
const winURL = process.env.NODE_ENV === 'development' ? `http://localhost:9080` : `file://${__dirname}/index.html`
-// Enforces single instance for linux and windows.
-const gotTheLock = app.requestSingleInstanceLock()
+// MAS build is not allowed requestSingleInstanceLock.
+// ref: https://github.com/h3poteto/whalebird-desktop/issues/1030
+// ref: https://github.com/electron/electron-osx-sign/issues/137#issuecomment-307626305
+if (process.platform !== 'darwin') {
+ // Enforces single instance for linux and windows.
+ const gotTheLock = app.requestSingleInstanceLock()
-if (!gotTheLock) {
- app.quit()
-} else {
- app.on('second-instance', () => {
- // Someone tried to run a second instance, we should focus our window.
- if (mainWindow) {
- if (mainWindow.isMinimized()) mainWindow.restore()
- if (!mainWindow!.isVisible()) {
- mainWindow!.show()
- mainWindow!.setSkipTaskbar(false)
+ if (!gotTheLock) {
+ app.quit()
+ } else {
+ app.on('second-instance', () => {
+ // Someone tried to run a second instance, we should focus our window.
+ if (mainWindow) {
+ if (mainWindow.isMinimized()) mainWindow.restore()
+ if (!mainWindow!.isVisible()) {
+ mainWindow!.show()
+ mainWindow!.setSkipTaskbar(false)
+ }
+ mainWindow.focus()
}
- mainWindow.focus()
- }
- })
+ })
+ }
}
const appId = pkg.build.appId