mirror of
https://github.com/grafana/grafana.git
synced 2025-09-22 20:02:52 +08:00
Build: Clean up scripts/grunt/options/phantomjs.js (#20503)
This commit is contained in:
@ -2,7 +2,6 @@ module.exports = function(config,grunt) {
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
grunt.registerTask('phantomjs', 'Copy phantomjs binary to vendor/', function() {
|
grunt.registerTask('phantomjs', 'Copy phantomjs binary to vendor/', function() {
|
||||||
|
|
||||||
var dest = './tools/phantomjs/phantomjs';
|
var dest = './tools/phantomjs/phantomjs';
|
||||||
var confDir = './node_modules/phantomjs-prebuilt/lib/';
|
var confDir = './node_modules/phantomjs-prebuilt/lib/';
|
||||||
|
|
||||||
@ -10,12 +9,10 @@ module.exports = function(config,grunt) {
|
|||||||
dest += ".exe";
|
dest += ".exe";
|
||||||
}
|
}
|
||||||
|
|
||||||
src = config.phjs
|
var src = config.phjs;
|
||||||
|
if (!src) {
|
||||||
if (!src){
|
var m = grunt.file.read(confDir+"location.js");
|
||||||
var m=grunt.file.read(confDir+"location.js")
|
src = /= \"([^\"]*)\"/.exec(m)[1];
|
||||||
var src=/= \"([^\"]*)\"/.exec(m)[1];
|
|
||||||
|
|
||||||
if (!grunt.file.isPathAbsolute(src)) {
|
if (!grunt.file.isPathAbsolute(src)) {
|
||||||
src = confDir+src;
|
src = confDir+src;
|
||||||
}
|
}
|
||||||
@ -32,6 +29,5 @@ module.exports = function(config,grunt) {
|
|||||||
grunt.verbose.writeln(err);
|
grunt.verbose.writeln(err);
|
||||||
grunt.fail.warn('No working Phantomjs binary available')
|
grunt.fail.warn('No working Phantomjs binary available')
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user