We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b8a15fc commit 969c875Copy full SHA for 969c875
core/util/findExecutable.js
@@ -1,9 +1,17 @@
1
var path = require('path');
2
3
module.exports = function(module, bin) {
4
+
5
+ if (module === 'phantomjs-prebuilt') {
6
+ return require('phantomjs-prebuilt').path;
7
+ }
8
9
+ // get the absolute path for package.json of a node_module
10
var packageJSON = require.resolve(path.join(module, 'package.json'));
11
12
+ // then get the executable name
13
var relativeBinary = require(packageJSON).bin[bin];
14
15
+ // return a path to the executable inside the execuatable's package
16
return path.join(packageJSON.replace('package.json', ''), relativeBinary);
17
};
0 commit comments