Skip to content
This repository has been archived by the owner on Jun 10, 2022. It is now read-only.

Commit

Permalink
External process changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Vernon committed Nov 13, 2016
1 parent 3297aee commit 7ff5d27
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
11 changes: 7 additions & 4 deletions lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,17 @@ let breakPackage = {
breakServerProcess.startServer().on('message', function(m) {
socket.open();
}).on('error', function(err){
atom.notifications.addWarning(
'Break: Node not found.',

// alert user if an error is recieved
atom.notifications.addError(
'Break;',
{
description: 'Break; requires that you have **Nodejs** installed on your system and available in your **path**. Node can be downloaded from the following link **[nodejs.org](https://nodejs.org/en/)**',
detail: 'Please install Nodejs before using Break;',
description: 'If this error continues please help us by opening an issue **[Here](https://github.com/VernonGrant/break/issues)**',
detail: 'Failed to start child process.',
dismissable: true
}
);

});

}
Expand Down
8 changes: 2 additions & 6 deletions lib/serverProcess.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,15 @@ export default class ServerProcess{
constructor(port, host = hostname){
this.port = port;
this.host = host;
this.childProcess = null;
}

/**
* Starts the external server process.
*
* @returns {ChildProcess}
*/
startServer(){
this.childProcess = childProcess.spawn('node', [serverScriptPath], {
startServer(socket){
return childProcess.fork(serverScriptPath, [], {
stdio: ['inherit', 'inherit', 'inherit', 'ipc']
});
return this.childProcess;
}

/**
Expand Down

0 comments on commit 7ff5d27

Please sign in to comment.