Skip to content

Commit

Permalink
findExecutable now makes exception for phantom
Browse files Browse the repository at this point in the history
  • Loading branch information
garris committed Sep 27, 2016
1 parent b8a15fc commit 969c875
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions core/util/findExecutable.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
var path = require('path');

module.exports = function(module, bin) {

if (module === 'phantomjs-prebuilt') {
return require('phantomjs-prebuilt').path;
}

// get the absolute path for package.json of a node_module
var packageJSON = require.resolve(path.join(module, 'package.json'));

// then get the executable name
var relativeBinary = require(packageJSON).bin[bin];

// return a path to the executable inside the execuatable's package
return path.join(packageJSON.replace('package.json', ''), relativeBinary);
};

0 comments on commit 969c875

Please sign in to comment.