Skip to content

Commit

Permalink
README: Update with macOS packaging, minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
whphhg committed May 21, 2017
1 parent 7ae2fdf commit dc74ad5
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 29 deletions.
26 changes: 19 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,7 @@ using `npm run dev` or `npm run dev-win` on Windows.
$ npm run dev (Linux and macOS)
$ npm run dev-win (Windows)

## Package and build for Linux and Windows
The following dependencies are required to be installed:
* docker (make sure your user is in the docker group)

## Package and build
To bundle the daemon with the GUI, name it `vcashd-arch`, where `arch` can
be either `ia32` or `x64` and place it into the `bin` directory. This directory
is checked for the current platform & arch daemon executable on start-up by
Expand All @@ -46,6 +43,10 @@ actually packaging the GUI run `npm run pack`.

$ npm run pack

### Linux and Windows (using Docker)
The following dependencies are required to be installed:
* docker (make sure your user is in the docker group)

Run the docker container.

$ docker run --rm -ti -v ${PWD}:/project -v ${PWD##*/}-node-modules:/project/node_modules -v ~/.electron:/root/.electron electronuserland/electron-builder:wine
Expand All @@ -68,12 +69,23 @@ dist-win32-x64 | x64 | Create a 64-bit Windows portable executable
`vcashd-ia32.exe` and `vcashd-x64.exe` in the `bin` directory. Other scripts
require only the daemon for the target arch of the platform they're packaging for.

## Linux and macOS
To package in a distributable format run one of the scripts from the table
below, which will create the packages for your current platform and save
them into the `dist` directory. Packages will be created according to the
`build` and `scripts` options in
[package.json](https://github.com/whphhg/vcash-electron/blob/master/package.json#L11-L33).

$ npm run <script>

Script | Target arch | Description
------ | ------ | ------
dist-linux | x64 | Create 64-bit Linux .deb and .zip packages
dist-mac | x64 | Create 64-bit macOS .dmg package

You can read more about the `electron-builder` options
[here](https://github.com/electron-userland/electron-builder/wiki/Options).

## Package and build for macOS
WIP

## License
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion bin/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Daemons
Placing a daemon executable named `vcashd-arch`, where `arch` can be either
Placing a daemon named `vcashd-arch`, where `arch` can be either
`ia32` or `x64` into this directory will spawn it on start-up if it matches
the correct platform and arch. It will also get bundled with the GUI when
you run any of the `npm run dist-` scripts.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"dev-win": "set NODE_ENV=dev&&electron .",
"pack": "build --dir",
"dist-linux": "build --linux --x64",
"dist-mac": "build --mac --x64",
"dist-nsis": "build --win nsis --ia32 --x64",
"dist-win32-x64": "build --win portable --x64",
"dist-win32-ia32": "build --win portable --ia32"
Expand Down Expand Up @@ -52,7 +53,7 @@
"dependencies": {
"antd": "2.10.1",
"electron-compile": "6.4.1",
"i18next": "8.2.1",
"i18next": "8.3.0",
"i18next-node-fs-backend": "1.0.0",
"mobx": "3.1.9",
"mobx-logger": "0.5.0",
Expand All @@ -74,7 +75,7 @@
"babel-preset-react": "6.24.1",
"babel-preset-stage-0": "6.24.1",
"babel-runtime": "6.23.0",
"electron-builder": "17.8.0",
"electron-builder": "17.10.0",
"electron-prebuilt-compile": "1.7.0",
"standard": "10.0.2"
}
Expand Down
14 changes: 2 additions & 12 deletions src/electron.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,22 +42,12 @@ app.on('ready', () => {
daemon.kill('SIGINT')
}

/**
* Dereference the window object, usually you would store windows
* in an array if your app supports multi windows, this is the time
* when you should delete the corresponding element.
*/
/** Dereference the window object. */
mainWindow = null
})
})

/** All of the windows are closed. */
app.on('window-all-closed', () => {
/**
* On macOS it is common for applications and their menu bar
* to stay active until the user quits explicitly with Cmd + Q.
*/
if (process.platform !== 'darwin') {
app.quit()
}
app.quit()
})
8 changes: 1 addition & 7 deletions src/stores/rpc.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,7 @@ export default class RPC {
body: JSON.stringify(options)
})
.then((response) => {
if (response.ok === true) {
try {
return response.json()
} catch (e) {
console.error('Received RPC response with invalid characters.', e)
}
}
if (response.ok === true) return response.json()
})
.then((data) => {
/** Update connection status. */
Expand Down

0 comments on commit dc74ad5

Please sign in to comment.