Ind.ie is now Small Technology Foundation.
Commit 875ec03c authored by Aral Balkan's avatar Aral Balkan

Now using node-cross-spawn

parent 5da1a67b
Pipeline #108 skipped
......@@ -18,6 +18,7 @@
"main": "./src/index.js",
"dependencies": {
"cross-exec-file": "^1.0.0",
"cross-spawn-async": "^2.1.9",
"electron-prebuilt": "^0.35.6",
"json-stable-stringify": "^1.0.0",
"object-assign": "^4.0.1",
......
var tmp = require('tmp');
var assign = require('object-assign');
var fs = require('fs');
var childProcess = require('child_process');
var spawn = require('cross-spawn-async');
/**
* @param {string} url url (e.g. http://google.com)
......@@ -53,6 +53,8 @@ module.exports = function electronHAR(url, options, callback) {
}, [])
)
console.log('ARGS: ' + args);
// The callback for the spawned process.
var processCallback = function (err, stdout, stderr) {
if (err) {
......@@ -78,7 +80,7 @@ module.exports = function electronHAR(url, options, callback) {
// Initialise the electron-har process using spawn
// as cross-exec-file (exec-file) results in stdout maxBuffer exceeded errors.
var command = childProcess.spawn(__dirname + '/../bin/electron-har', args)
var command = spawn(__dirname + '/../bin/electron-har', args)
var result = ''
command.stdout.on('data', function(data){
result += data.toString();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment