-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutils.js
More file actions
23 lines (20 loc) · 835 Bytes
/
Copy pathutils.js
File metadata and controls
23 lines (20 loc) · 835 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
var fs = require('fs');
var path = require('path');
module.exports = {
// Get the path to the phantomjs executable
getPhantomPath: function () {
var phantomPath = path.join(__dirname, '..', 'node_modules', 'phantomjs', 'bin', 'phantomjs');
if (fs.existsSync(phantomPath)) {
return phantomPath;
}
return path.join(__dirname, '..', 'bin', 'phantomjs');
},
// Get the path to the casperjs executable
getCasperPath: function () {
var casperPath = path.join(__dirname, '..', 'node_modules', 'casperjs', 'bin', 'casperjs');
if (!fs.existsSync(casperPath)) {
throw new Error('Not able to find "casperjs" executable in "node_modules". Please run `$ npm install` to install the project dependencies.');
}
return casperPath;
},
};