Commit 4fe49a38 authored by Stanley Shyiko's avatar Stanley Shyiko

Merge pull request #4 from bmcminn/master

Added cross-exec-file package to handle windows .cmd needs
parents 5f9e8422 fa53222d
@IF EXIST "%~dp0\node.exe" (
"%~dp0\node.exe" "%~dp0electron-har" %*
) ELSE (
@SETLOCAL
@SET PATHEXT=%PATHEXT:;.JS;=;%
node "%~dp0electron-har" %*
)
...@@ -11,11 +11,12 @@ ...@@ -11,11 +11,12 @@
"bin": "./bin/electron-har", "bin": "./bin/electron-har",
"main": "./src/index.js", "main": "./src/index.js",
"dependencies": { "dependencies": {
"yargs": "^3.31.0", "cross-exec-file": "^1.0.0",
"json-stable-stringify": "^1.0.0",
"electron-prebuilt": "^0.35.4", "electron-prebuilt": "^0.35.4",
"json-stable-stringify": "^1.0.0",
"object-assign": "^4.0.1", "object-assign": "^4.0.1",
"tmp": "^0.0.28" "tmp": "^0.0.28",
"yargs": "^3.31.0"
}, },
"devDependencies": { "devDependencies": {
"electron-packager": "^5.1.1", "electron-packager": "^5.1.1",
...@@ -24,7 +25,12 @@ ...@@ -24,7 +25,12 @@
"semistandard": "^7.0.4" "semistandard": "^7.0.4"
}, },
"semistandard": { "semistandard": {
"globals": ["chrome", "describe", "it", "before"] "globals": [
"chrome",
"describe",
"it",
"before"
]
}, },
"scripts": { "scripts": {
"clean": "rm -rf build", "clean": "rm -rf build",
......
...@@ -2,6 +2,7 @@ var tmp = require('tmp'); ...@@ -2,6 +2,7 @@ var tmp = require('tmp');
var assign = require('object-assign'); var assign = require('object-assign');
var fs = require('fs'); var fs = require('fs');
var execFile = require('child_process').execFile; var execFile = require('child_process').execFile;
var crossExecFile = require('cross-exec-file');
/** /**
* @param {string} url url (e.g. http://google.com) * @param {string} url url (e.g. http://google.com)
...@@ -30,7 +31,7 @@ module.exports = function electronHAR(url, o, cb) { ...@@ -30,7 +31,7 @@ module.exports = function electronHAR(url, o, cb) {
user: o.user === Object(o.user) ? user: o.user === Object(o.user) ?
o.user.name + ':' + o.user.password : o.user o.user.name + ':' + o.user.password : o.user
}); });
execFile( crossExecFile(
__dirname + '/../bin/electron-har', __dirname + '/../bin/electron-har',
[url].concat(Object.keys(oo).reduce(function (r, k) { [url].concat(Object.keys(oo).reduce(function (r, k) {
var v = oo[k]; var v = oo[k];
......
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