Skip to content

Commit

Permalink
Merge pull request #26 from louisbourque/master
Browse files Browse the repository at this point in the history
Add linux target to build task
  • Loading branch information
bhstahl authored May 28, 2017
2 parents 349d31b + d2796ab commit fb102a0
Show file tree
Hide file tree
Showing 9 changed files with 51 additions and 0 deletions.
Binary file added build_assets/icons/partyshare.icns_128x128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build_assets/icons/partyshare.icns_24x24.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build_assets/icons/partyshare.icns_256x256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build_assets/icons/partyshare.icns_32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build_assets/icons/partyshare.icns_48x48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build_assets/icons/partyshare.icns_64x64.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,31 @@
"productName": "Partyshare",
"icon": "build_assets/partyshare.icns",
"forceCodeSigning": true,
"directories": {
"buildResources": "build_assets"
},
"dmg": {
"background": "build_assets/background.tiff",
"title": "Install ${productName}"
},
"linux": {
"target": [
{
"target": "deb",
"arch": [
"x64"
]
},
{
"target": "tar.gz",
"arch": [
"x64"
]
}
],
"category": "public.app-category.productivity",
"icon":"icons"
},
"publish": [
{
"provider": "github",
Expand Down
29 changes: 29 additions & 0 deletions src/electron/classes/IPFSSync.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ class IPFSSync extends EventEmitter {
this._startDaemon = this._startDaemon.bind(this);
this.setState = this.setState.bind(this);
this.start = this.start.bind(this);
this.quit = this.quit.bind(this);
this.watch = this.watch.bind(this);
return this;
}
Expand Down Expand Up @@ -227,6 +228,19 @@ class IPFSSync extends EventEmitter {
});
}


/**
* Attempt to stop daemon
* @param {Node} node
*/
_stopDaemon(node) {
node.stopDaemon((err, daemon) => {
if (err) {
logger.error('[IPFSSync] stopIPFSDaemon', err);
}
});
}

// Public API ____________________________________________________________
get state() {
logger.info('[IPFSSync] get state');
Expand Down Expand Up @@ -261,12 +275,27 @@ class IPFSSync extends EventEmitter {

return this._getNode()
.then(this._initNode)
.then((node) => {
this.setState({ node });
return node;
})
.then(this._startDaemon)
.then((daemon) => this.setState({ daemon, connected: true }))
.then(() => this._readAndSyncFiles())
.catch((e) => logger.error('[IPFSSync] startIPFS: ', e));
}

/**
* Quit IPFS
*/
quit() {
logger.info('[IPFSSync] quit');

if (this._state.connected) {
this._stopDaemon(this._state.node);
}
}

/**
* Manually trigger the folder watch, called automatically in start().
*/
Expand Down
1 change: 1 addition & 0 deletions src/electron/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ ipcMain.on(IPC_EVENT_HIDE_MENU, () => {

ipcMain.on(IPC_EVENT_QUIT_APP, () => {
mb.app.quit();
ipfsSync.quit();
});

ipcMain.on(IPC_EVENT_NOTIFICATION, (event, text) => {
Expand Down

0 comments on commit fb102a0

Please sign in to comment.