From 253ae17be291f346e089eb504b0eb5d33dbd2eed Mon Sep 17 00:00:00 2001 From: Amaury Martiny Date: Mon, 25 Jun 2018 15:10:14 +0200 Subject: [PATCH 1/3] Binaries build 1 --- packages/fether-electron/package.json | 2 ++ packages/fether-electron/scripts/revertElectronBug.sh | 10 ++++++++++ 2 files changed, 12 insertions(+) create mode 100755 packages/fether-electron/scripts/revertElectronBug.sh diff --git a/packages/fether-electron/package.json b/packages/fether-electron/package.json index f45e526e..e7c238db 100644 --- a/packages/fether-electron/package.json +++ b/packages/fether-electron/package.json @@ -32,7 +32,9 @@ "build": "electron-webpack", "electron": "electron dist/main/main.js --light", "lint": "semistandard 'src/**/*.js' --parser babel-eslint", + "prepackage": "./scripts/revertElectronBug.sh", "package": "electron-builder", + "prerelease": "./scripts/revertElectronBug.sh", "release": "electron-builder", "start": "cross-env ELECTRON_START_URL=http://localhost:3000 electron-webpack dev --light --ws-origins all", "test": "echo Skipped." diff --git a/packages/fether-electron/scripts/revertElectronBug.sh b/packages/fether-electron/scripts/revertElectronBug.sh new file mode 100755 index 00000000..dad995d8 --- /dev/null +++ b/packages/fether-electron/scripts/revertElectronBug.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +# This is the revert patch from ./fixElectronBug.sh +FIND='"${path.join(configurator.projectDir, "static").replace(\/\\\\\/g, "\\\\\\\\")}"' +REPLACE='process.resourcesPath + "\/static"' +FILE='./node_modules/electron-webpack/out/targets/MainTarget.js' +case "$OSTYPE" in + darwin*) sed -i '.bak' "s/$FIND/$REPLACE/g" $FILE ;; + *) sed -i "s/$FIND/$REPLACE/g" $FILE ;; +esac -- GitLab From f68212a49cc29ecd92a89f7d38ce2b740de7e33a Mon Sep 17 00:00:00 2001 From: Amaury Martiny Date: Mon, 25 Jun 2018 15:40:38 +0200 Subject: [PATCH 2/3] Use static path --- packages/fether-electron/src/main/index.js | 5 ++--- .../src/main/utils/staticPath.js | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 packages/fether-electron/src/main/utils/staticPath.js diff --git a/packages/fether-electron/src/main/index.js b/packages/fether-electron/src/main/index.js index 24624ee0..f9214df4 100644 --- a/packages/fether-electron/src/main/index.js +++ b/packages/fether-electron/src/main/index.js @@ -3,8 +3,6 @@ // // SPDX-License-Identifier: BSD-3-Clause -/* global __static */ - import electron from 'electron'; import path from 'path'; import url from 'url'; @@ -17,6 +15,7 @@ import messages from './messages'; import { productName } from '../../electron-builder.json'; import Pino from './utils/pino'; import { runParity, killParity } from './operations/runParity'; +import staticPath from './utils/staticPath'; const { app, BrowserWindow, ipcMain, session } = electron; let mainWindow; @@ -39,7 +38,7 @@ function createWindow () { mainWindow.loadURL( process.env.ELECTRON_START_URL || url.format({ - pathname: path.join(__static, 'build', 'index.html'), + pathname: path.join(staticPath, 'build', 'index.html'), protocol: 'file:', slashes: true }) diff --git a/packages/fether-electron/src/main/utils/staticPath.js b/packages/fether-electron/src/main/utils/staticPath.js new file mode 100644 index 00000000..677d7bc9 --- /dev/null +++ b/packages/fether-electron/src/main/utils/staticPath.js @@ -0,0 +1,19 @@ +// Copyright 2015-2018 Parity Technologies (UK) Ltd. +// This file is part of Parity. +// +// SPDX-License-Identifier: BSD-3-Clause + +/* global __static */ + +const isDevelopment = process.env.NODE_ENV === 'development'; + +/** + * Get the path to the `static` folder. + * + * @see https://github.com/electron-userland/electron-webpack/issues/52 + */ +const staticPath = isDevelopment + ? __static + : __dirname.replace(/app\.asar$/, 'static'); + +export default staticPath; -- GitLab From 7c416a3e16624143af5abdadbca34c5fccf3912e Mon Sep 17 00:00:00 2001 From: Amaury Martiny Date: Mon, 25 Jun 2018 15:53:52 +0200 Subject: [PATCH 3/3] Add readme to binaries --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index a35f97af..689333bf 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,9 @@ # Fether Wallet +## Get the latest binary + +https://github.com/parity-js/fether/releases + ## Getting started ```bash -- GitLab