Skip to content
This repository was archived by the owner on Dec 4, 2019. It is now read-only.

Commit 377b96f

Browse files
committed
Merge pull request #358 from cdaniel/master
resolves #355 - Adopt phantomjs-prebuilt
2 parents 137bfc6 + bbd49ae commit 377b96f

2 files changed

Lines changed: 14 additions & 5 deletions

File tree

package.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
{
1313
"name": "Amir Raminfar",
1414
"email": "findamir@gmail.com"
15+
},
16+
{
17+
"name": "Krzysztof Daniel",
18+
"email": "krzysztof.daniel@gmail.com"
1519
}
1620
],
1721
"main": "phantom.js",
@@ -22,7 +26,8 @@
2226
"dnode": ">=1.2.2",
2327
"shoe": "~0.0.15",
2428
"win-spawn": "~2.0.0",
25-
"traverse": "~0.6.3"
29+
"traverse": "~0.6.3",
30+
"phantomjs": "~1.9.7-5"
2631
},
2732
"devDependencies": {
2833
"browserify": "10.0.0",
@@ -32,8 +37,7 @@
3237
"temp": "~0.4.0",
3338
"ps-tree": "~0.0.2",
3439
"vows": "~0.7.0",
35-
"bluebird": "~1.2.3",
36-
"phantomjs": "~1.9.7-5"
40+
"bluebird": "~1.2.3"
3741
},
3842
"license": "MIT",
3943
"scripts": {

phantom.coffee

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,13 @@ module.exports =
6161
if typeof options.parameters is 'object'
6262
for key, value of options.parameters
6363
args.push '--'+key+'='+value
64-
options.path ?= ''
65-
options.binary ?= options.path+'phantomjs'
64+
65+
if require('phantomjs').path?
66+
options.binary = require('phantomjs').path
67+
else
68+
options.path ?= ''
69+
options.binary ?= options.path+'phantomjs'
70+
6671
options.port ?= 0
6772
options.hostname ?= 'localhost'
6873
options.dnodeOpts ?= {}

0 commit comments

Comments
 (0)