From f9670a868acaf7cf974ac1f409d2ed908d023d2a Mon Sep 17 00:00:00 2001 From: Fritz Lin Date: Sun, 18 Jun 2017 16:56:02 +0800 Subject: [PATCH] add electron test to unix-sqlcipher ref: https://github.com/fritx/win-sqlcipher/issues/1 ref: https://github.com/fritx/win-sqlcipher/issues/2 --- electron/main.html | 27 +++++++++++++++++++++++++++ electron/main.js | 12 ++++++++++++ electron/package.json | 13 +++++++++++++ package.json | 1 + 4 files changed, 53 insertions(+) create mode 100644 electron/main.html create mode 100644 electron/main.js create mode 100644 electron/package.json diff --git a/electron/main.html b/electron/main.html new file mode 100644 index 0000000..1bbc2e0 --- /dev/null +++ b/electron/main.html @@ -0,0 +1,27 @@ + diff --git a/electron/main.js b/electron/main.js new file mode 100644 index 0000000..906c128 --- /dev/null +++ b/electron/main.js @@ -0,0 +1,12 @@ +let { app, BrowserWindow } = require('electron') +let { join } = require('path') + +let win + +app.on('ready', () => { + let url = 'file://' + join(__dirname, 'main.html') + win = new BrowserWindow() + win.loadURL(url) + + win.openDevTools() +}) diff --git a/electron/package.json b/electron/package.json new file mode 100644 index 0000000..c6d04d4 --- /dev/null +++ b/electron/package.json @@ -0,0 +1,13 @@ +{ + "name": "electron-test", + "main": "main.js", + "scripts": { + "rebuild": "electron-rebuild", + "start": "electron ." + }, + "devDependencies": { + "cross-sqlcipher": "0.0.2", + "electron": "^1.6.10", + "electron-rebuild": "^1.5.11" + } +} diff --git a/package.json b/package.json index f1591a6..e17c571 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "scripts": { "test": "node test", "nwtest": "nw nw", + "electron-test": "electron electron", "nwbuild": "npm i --runtime=node-webkit --target=0.12.3 --target_arch=x64", "preinstall": "node preinstall", "postinstall": "node postinstall"