mirror of
https://github.com/h3poteto/whalebird-desktop
synced 2025-01-11 08:24:58 +01:00
fix: Fix database path for production
This commit is contained in:
parent
240f79c3d9
commit
1224191fc0
15
Makefile
15
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)
|
||||
|
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "whalebird",
|
||||
"version": "0.0.0",
|
||||
"version": "0.1.0",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
@ -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
|
||||
})
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user