Skip to content

Commit

Permalink
Replace child_process with cross-spawn so that the library works on W…
Browse files Browse the repository at this point in the history
…indows and Mac (haven't tested on Unix). Updated the .gitignore file so that I don't commit .ds_store files
  • Loading branch information
jamesryanbell committed Jan 4, 2015
1 parent 712bf23 commit b05e1c9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
*.swp
node_modules
.ds_store
4 changes: 2 additions & 2 deletions lib/webshot.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var url = require('url')
, fs = require('fs')
, tmp = require('tmp')
, stream = require('stream')
, childProcess = require('child_process')
, crossSpawn = require('cross-spawn')
, optUtils = require('./options')
, phantomScript = __dirname + '/webshot.phantom.js'
, extensions = ['jpeg', 'jpg', 'png', 'pdf']
Expand Down Expand Up @@ -179,7 +179,7 @@ function spawnPhantom(site, path, streaming, options, cb) {
}).concat(phantomArgs);
}

var phantomProc = childProcess.spawn(options.phantomPath, phantomArgs);
var phantomProc = crossSpawn.spawn(options.phantomPath, phantomArgs);

// This variable will contain our timeout ID.
var timeoutID = null;
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,16 @@
"node >=0.7.00"
],
"dependencies": {
"cross-spawn": "^0.2.3",
"tmp": "~0.0.23"
},
"optionalDependencies": {
"phantomjs": "~1.9.7-1"
},
"devDependencies": {
"imagemagick": "git://github.com/rsms/node-imagemagick.git",
"mocha": "*",
"should": "*",
"imagemagick": "git://github.com/rsms/node-imagemagick.git"
"should": "*"
},
"main": "./lib/webshot.js",
"scripts": {
Expand Down

0 comments on commit b05e1c9

Please sign in to comment.