Skip to content
This repository has been archived by the owner on Sep 7, 2022. It is now read-only.

Commit

Permalink
fix: path issue with phantomjs and phantomjs-prebuilt
Browse files Browse the repository at this point in the history
Change to use phantomPackage._location instead of hardcoded phantomjs
which works with both phantomjs and phantomjs-prebuilt.
  • Loading branch information
leightarasenko committed Dec 4, 2016
1 parent fb11f35 commit 482eba5
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions index.js
Expand Up @@ -13,12 +13,11 @@ var phantomJSExePath = function () {
// If the path we're given by phantomjs is to a .cmd, it is pointing to a global copy.
// Using the cmd as the process to execute causes problems cleaning up the processes
// so we walk from the cmd to the phantomjs.exe and use that instead.

var phantomSource = require('phantomjs-prebuilt').path

if (path.extname(phantomSource).toLowerCase() === '.cmd') {
var phantomPackage = require('phantomjs-prebuilt/package.json')
return path.join(path.dirname(phantomSource), '//node_modules//phantomjs//lib//phantom//', phantomPackage.bin.phantomjs)
return path.join(path.dirname(phantomSource), '//node_modules/' + phantomPackage._location + '//lib//phantom//', phantomPackage.bin.phantomjs)
}

return phantomSource
Expand Down

0 comments on commit 482eba5

Please sign in to comment.