mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
[start] send extra args to the kibana process
Original commit: elastic/kibana-plugin-helpers@ce943ca67c
This commit is contained in:
parent
ec965190d6
commit
6790982d08
3 changed files with 20 additions and 7 deletions
|
@ -5,15 +5,18 @@ var program = require('commander');
|
|||
var pkg = require('../package.json');
|
||||
var run = require('../lib/run');
|
||||
var docs = require('../lib/docs');
|
||||
var enableCollectingUnknownOptions = require('../lib/enable_collecting_unknown_options');
|
||||
|
||||
program
|
||||
.version(pkg.version);
|
||||
|
||||
program
|
||||
.command('start')
|
||||
.description('Start kibana and have it include this plugin')
|
||||
.on('--help', docs('start'))
|
||||
.action(run('start'));
|
||||
enableCollectingUnknownOptions(
|
||||
program
|
||||
.command('start')
|
||||
.description('Start kibana and have it include this plugin')
|
||||
.on('--help', docs('start'))
|
||||
.action(run('start'))
|
||||
);
|
||||
|
||||
program
|
||||
.command('build')
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
|
||||
module.exports = function enableCollectingUnknownOptions(command) {
|
||||
var origParse = command.parseOptions;
|
||||
command.allowUnknownOption();
|
||||
command.parseOptions = function (argv) {
|
||||
let opts = origParse.call(this, argv);
|
||||
this.unkownOptions = opts.unknown;
|
||||
return opts;
|
||||
};
|
||||
};
|
|
@ -1,11 +1,11 @@
|
|||
module.exports = function (plugin) {
|
||||
module.exports = function (plugin, command) {
|
||||
var resolve = require('path').resolve;
|
||||
var execFileSync = require('child_process').execFileSync;
|
||||
|
||||
var kibanaDir = resolve(plugin.root, '../kibana');
|
||||
|
||||
var cmd = (process.platform === 'win32') ? 'bin\\kibana.bat' : 'bin/kibana';
|
||||
var args = ['--dev', '--plugin-path', plugin.root];
|
||||
var args = ['--dev', '--plugin-path', plugin.root, ...command.unkownOptions];
|
||||
execFileSync(cmd, args, {
|
||||
cwd: kibanaDir,
|
||||
stdio: 'inherit'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue