Skip to content
This repository has been archived by the owner on Jan 31, 2024. It is now read-only.

Commit

Permalink
Feat: add includePlugins setting (#49)
Browse files Browse the repository at this point in the history
* observe includePlugins setting

* fix: move resolve up to config parser

this ensures that the path is resolved relative to the plugin root
  • Loading branch information
w33ble authored Sep 26, 2017
1 parent dba9da1 commit fd07d61
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/config_file.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 6 additions & 0 deletions tasks/start/start_action.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit fd07d61

Please sign in to comment.