Feat: add includePlugins setting (elastic/kibana-plugin-helpers#49)

* observe includePlugins setting

* fix: move resolve up to config parser

this ensures that the path is resolved relative to the plugin root

Original commit: elastic/kibana-plugin-helpers@fd07d617a4
This commit is contained in:
Joe Fleming 2017-09-26 14:45:54 -07:00 committed by GitHub
parent 607354978f
commit b73576b4d5
2 changed files with 12 additions and 2 deletions

View file

@ -24,8 +24,12 @@ module.exports = function (root) {
}
});
// if the kibanaRoot is set, use resolve to ensure correct resolution
if (config.kibanaRoot) config.kibanaRoot = resolve(root, config.kibanaRoot);
// use resolve to ensure correct resolution of paths
const { kibanaRoot, includePlugins } = config;
if (kibanaRoot) config.kibanaRoot = resolve(root, kibanaRoot);
if (includePlugins) config.includePlugins = includePlugins.map(path => resolve(root, path));
// allow env setting to override kibana root from config
if (KIBANA_ROOT_OVERRIDE) config.kibanaRoot = KIBANA_ROOT_OVERRIDE;
return config;

View file

@ -6,6 +6,12 @@ module.exports = function (plugin, run, options) {
const cmd = (process.platform === 'win32') ? 'bin\\kibana.bat' : 'bin/kibana';
let args = ['--dev', '--plugin-path', plugin.root];
if (Array.isArray(plugin.includePlugins)) {
plugin.includePlugins.forEach((path) => {
args = args.concat(['--plugin-path', path]);
});
}
if (options.flags) {
args = args.concat(options.flags);
}