From 1224191fc0c895bb36b3e884c4980ad3acd2169d Mon Sep 17 00:00:00 2001
From: AkiraFukushima
Date: Thu, 22 Mar 2018 16:49:39 +0900
Subject: [PATCH 1/2] fix: Fix database path for production
---
Makefile | 15 ++++++++++-----
package-lock.json | 2 +-
src/main/index.js | 6 +++++-
3 files changed, 16 insertions(+), 7 deletions(-)
diff --git a/Makefile b/Makefile
index a5328fe7..4cdeeea0 100644
--- a/Makefile
+++ b/Makefile
@@ -1,17 +1,22 @@
-.PHONY: release-build package
+.PHONY: install release-build package
VERSION = 0.0.0
PLATFORM = linux
+CERTNAME = ""
ICON = ""
+CERT = ""
ifeq (${PLATFORM}, darwin)
- ICON = "--icon=./build/icons/whalebird.icns"
+ ICON = --icon=./build/icons/whalebird.icns
+ CERT = --sign='${CERTNAME}'
endif
ifeq (${PLATFORM}, windows)
- ICON = "--icon=./build/icons/whalebird.ico"
+ ICON = --icon=./build/icons/whalebird.ico
endif
-all: release-build package
+all: install release-build package
+install: package.json
+ npm install
release-build: package.json
npm run pack
package: release-build
- electron-packager ./ whalebird --platform=${PLATFORM} --arch=x64 --electron-version=1.8.3 --build-version=${VERSION} --asar --out=packages --ignore="^/src" --ignore="^/test" --ignore="^/.electron-vue" --ignore="^/.envrc" --prune=true ${ICON}
+ electron-packager ./ whalebird --platform=${PLATFORM} --arch=x64 --electron-version=1.8.3 --build-version=${VERSION} --asar --out=packages --ignore="^/src" --ignore="^/test" --ignore="^/.electron-vue" --ignore="^/.envrc" --prune=true $(ICON) $(CERT)
diff --git a/package-lock.json b/package-lock.json
index 71dc963f..1973f949 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,6 +1,6 @@
{
"name": "whalebird",
- "version": "0.0.0",
+ "version": "0.1.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
diff --git a/src/main/index.js b/src/main/index.js
index 01d1d8a0..1c515155 100644
--- a/src/main/index.js
+++ b/src/main/index.js
@@ -21,8 +21,12 @@ const winURL = process.env.NODE_ENV === 'development'
? `http://localhost:9080`
: `file://${__dirname}/index.html`
+const userData = app.getPath('userData')
+const databasePath = process.env.NODE_ENV === 'production'
+ ? userData + '/db/whalebird.db'
+ : 'whalebird.db'
let db = new Datastore({
- filename: 'whalebird.db',
+ filename: databasePath,
autoload: true
})
From 26a43364a6d3a1838676321888f19e9522cc1d19 Mon Sep 17 00:00:00 2001
From: AkiraFukushima
Date: Thu, 22 Mar 2018 16:55:58 +0900
Subject: [PATCH 2/2] fix: Add license in package.json
---
package.json | 8 ++++++--
src/main/index.js | 1 +
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/package.json b/package.json
index 86e51aec..0e88a7dc 100644
--- a/package.json
+++ b/package.json
@@ -2,8 +2,12 @@
"name": "whalebird",
"version": "0.1.0",
"author": "AkiraFukushima ",
- "description": "A mastodon client",
- "license": null,
+ "description": "A desktop mastodon client",
+ "license": "MIT",
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/h3poteto/whalebird-desktop.git"
+ },
"main": "./dist/electron/main.js",
"scripts": {
"build": "node .electron-vue/build.js && electron-builder",
diff --git a/src/main/index.js b/src/main/index.js
index 1c515155..7643ce59 100644
--- a/src/main/index.js
+++ b/src/main/index.js
@@ -21,6 +21,7 @@ const winURL = process.env.NODE_ENV === 'development'
? `http://localhost:9080`
: `file://${__dirname}/index.html`
+// https://github.com/louischatriot/nedb/issues/459
const userData = app.getPath('userData')
const databasePath = process.env.NODE_ENV === 'production'
? userData + '/db/whalebird.db'