Skip to content

Commit

Permalink
prepared piped stdin
Browse files Browse the repository at this point in the history
  • Loading branch information
s-a committed Jan 23, 2016
1 parent 522154c commit e844eac
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 2 deletions.
18 changes: 17 additions & 1 deletion app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,22 @@ var path = require('path'); // Module to control application life.
var BrowserWindow = require('browser-window'); // Module to create native browser window.
var Mnu = require('./menu.js');


/*
var lingeringLine = "";
process.stdin.on('data', function(chunk) {
console.log("data", chunk);
lingeringLine += chunk;
});
process.stdin.on('end', function() {
console.log("+", lingeringLine);
});
*/

// Report crashes to our server.
//require('crash-reporter').start();

Expand Down Expand Up @@ -80,7 +96,6 @@ app.on('ready', function() {
menu.init(mainWindow);

mainWindow.maximize();
mainWindow.openDevTools({detach : config.settings.app.openDevToolsDetached});


mainWindow.on('closed', function() {
Expand All @@ -104,5 +119,6 @@ app.on('ready', function() {
}
});

mainWindow.openDevTools({detach : config.settings.app.openDevToolsDetached});
}
});
22 changes: 21 additions & 1 deletion bin/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,26 @@ for (var i = 2; i < process.argv.length; i++) {
args.push(arg);
}

/*
var lingeringLine = "";
process.stdin.on('data', function(chunk) {
console.log("data", chunk);
lingeringLine += chunk;
});
process.stdin.on('end', function() {
console.log("-", lingeringLine);
});
*/
// spawn electron
proc.spawn(electron, args);
var _process = proc.spawn(electron, args/*, {
stdio: [ process.stdin, process.stdout, process.stderr],
cwd: process.cwd,
env: process.env
}*/);

_process.on('close', function (code) {
process.exit(code);
});
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"changelog": "changelog -m",
"dev": "node_modules/.bin/electron ./app",
"node-sass-test": "node_modules/.bin/electron ./app ..\\require\\node-sass.js",
"pipe-test": "echo \"var i = 0; debugger;\" | node bin/run.js",
"edge-test": "node_modules/.bin/electron ./app ..\\require\\edge.js",
"mocha-debug": "node_modules/.bin/electron ./app node_modules/mocha/bin/_mocha",
"test-notify": "node_modules/.bin/electron ./app ..\\require\\notify.js",
Expand Down

0 comments on commit e844eac

Please sign in to comment.