mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
Merge pull request #4314 from BigFunger/require-plugins-windowz
Fixed paths for plugins in windows
This commit is contained in:
commit
c39cd847a9
2 changed files with 7 additions and 6 deletions
|
@ -6,6 +6,7 @@ var plugins = function (dir) {
|
|||
if (!dir) return [];
|
||||
var files = glob.sync(path.join(dir, '*', 'index.js')) || [];
|
||||
return files.map(function (file) {
|
||||
dir = dir.replace(/\\/g, '/');
|
||||
return file.replace(dir, 'plugins').replace(/\.js$/, '');
|
||||
});
|
||||
};
|
||||
|
@ -23,5 +24,4 @@ module.exports = function (server) {
|
|||
cache = bundled_plugin_ids.concat(bundled_plugins, external_plugins);
|
||||
}
|
||||
return cache;
|
||||
};
|
||||
|
||||
};
|
|
@ -5,17 +5,18 @@ var Promise = require('bluebird');
|
|||
var checkPath = require('../config/check_path');
|
||||
|
||||
module.exports = function (globPath) {
|
||||
globPath = globPath || join( __dirname, '..', '..', 'plugins', '*', 'index.js');
|
||||
globPath = globPath || join(__dirname, '..', '..', 'plugins', '*', 'index.js');
|
||||
return glob.sync(globPath).map(function (file) {
|
||||
var module = require(file);
|
||||
var regex = new RegExp('([^' + path.sep + ']+)' + path.sep + 'index.js');
|
||||
var regex = new RegExp('([^/]+)/index.js');
|
||||
|
||||
var matches = file.match(regex);
|
||||
if (!module.name && matches) {
|
||||
module.name = matches[1];
|
||||
}
|
||||
|
||||
// has a public folder?
|
||||
var publicPath = module.publicPath || join(path.dirname(file), 'public');
|
||||
var publicPath = (module.publicPath || join(path.dirname(file), 'public')).replace(/\\/g, '/');
|
||||
if (checkPath(publicPath)) {
|
||||
module.publicPath = publicPath;
|
||||
if (!module.publicPlugins) {
|
||||
|
@ -28,4 +29,4 @@ module.exports = function (globPath) {
|
|||
|
||||
return module;
|
||||
});
|
||||
};
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue