Skip to content

Commit

Permalink
app: update electron to latest
Browse files Browse the repository at this point in the history
This updates electron and fixes the distribution build of the app
  • Loading branch information
evanlucas committed Jun 26, 2017
1 parent db3bf32 commit f10b3e4
Show file tree
Hide file tree
Showing 4 changed files with 4,123 additions and 9 deletions.
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
NAME ?= eyearesee
VERSION ?= $(shell node -pe 'require(`./package`).version')
ELECTRON_VERSION ?= 0.37.2
ELECTRON_VERSION ?= 1.6.11
BUNDLE_ID ?= com.evanlucas.$(NAME)
OUT ?= build/

Expand All @@ -14,10 +14,11 @@ help:
package-osx: build-css ## Create a package of the app for OS X
node_modules/.bin/electron-packager . $(NAME) --platform=darwin --arch=x64 \
--version=$(ELECTRON_VERSION) \
--icon=resources/icon.icns \
--icon=build/icon.icns \
--app-version=$(VERSION) \
--app-bundle-id=$(BUNDLE_ID) \
--prune \
--overwrite \
--out=$(OUT)

clean: ## Remove old generated apps
Expand Down
8 changes: 6 additions & 2 deletions lib/db.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,20 @@ function DB() {
inherits(DB, EE)

DB.prototype._trySetup = function _trySetup() {
debug('try setup')
try {
const remote = require('remote')
const app = remote.require('app')
const {remote} = require('electron')
const app = remote.app
const appDir = app.getPath('appData')
const dbDir = path.join(appDir, 'eyearesee', 'db')
debug('app dir %s', appDir)
debug('db dir %s', dbDir)
this._db = levelup(dbDir, {
db: leveldown
, valueEncoding: 'json'
})
} catch (err) {
console.error('failed to create db', err)
this._db = levelup('./eyearesee', {
db: leveldown
, valueEncoding: 'json'
Expand Down
Loading

0 comments on commit f10b3e4

Please sign in to comment.