Deprecate --plugin-dir option in cli (#15390) (#15468)

This commit is contained in:
Kim Joar Bekkelund 2017-12-07 11:16:44 +01:00 committed by GitHub
parent ac69b5bc16
commit 34bfb33a65
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 20 additions and 3 deletions

View file

@ -4,6 +4,7 @@ import Logger from '../lib/logger';
import { getConfig } from '../../server/path';
import { parse, parseMilliseconds } from './settings';
import logWarnings from '../lib/log_warnings';
import { warnIfUsingPluginDirOption } from '../lib/warn_if_plugin_dir_option';
function processCommand(command, options) {
let settings;
@ -16,6 +17,8 @@ function processCommand(command, options) {
}
const logger = new Logger(settings);
warnIfUsingPluginDirOption(options, fromRoot('plugins'), logger);
logWarnings(settings, logger);
install(settings, logger);
}
@ -37,7 +40,7 @@ export default function pluginInstall(program) {
)
.option(
'-d, --plugin-dir <path>',
'path to the directory where plugins are stored',
'path to the directory where plugins are stored (DEPRECATED, known to not work for all plugins)',
fromRoot('plugins')
)
.description('install a plugin',

View file

@ -0,0 +1,8 @@
export function warnIfUsingPluginDirOption(options, defaultValue, logger) {
if (options.pluginDir !== defaultValue) {
logger.log(
'Warning: Using the -d, --plugin-dir option is deprecated, and is ' +
'known to not work for all plugins, including X-Pack.'
);
}
}

View file

@ -3,6 +3,7 @@ import list from './list';
import Logger from '../lib/logger';
import { parse } from './settings';
import logWarnings from '../lib/log_warnings';
import { warnIfUsingPluginDirOption } from '../lib/warn_if_plugin_dir_option';
function processCommand(command, options) {
let settings;
@ -15,6 +16,8 @@ function processCommand(command, options) {
}
const logger = new Logger(settings);
warnIfUsingPluginDirOption(options, fromRoot('plugins'), logger);
logWarnings(settings, logger);
list(settings, logger);
}
@ -24,7 +27,7 @@ export default function pluginList(program) {
.command('list')
.option(
'-d, --plugin-dir <path>',
'path to the directory where plugins are stored',
'path to the directory where plugins are stored (DEPRECATED, known to not work for all plugins)',
fromRoot('plugins')
)
.description('list installed plugins')

View file

@ -4,6 +4,7 @@ import Logger from '../lib/logger';
import { parse } from './settings';
import { getConfig } from '../../server/path';
import logWarnings from '../lib/log_warnings';
import { warnIfUsingPluginDirOption } from '../lib/warn_if_plugin_dir_option';
function processCommand(command, options) {
let settings;
@ -16,6 +17,8 @@ function processCommand(command, options) {
}
const logger = new Logger(settings);
warnIfUsingPluginDirOption(options, fromRoot('plugins'), logger);
logWarnings(settings, logger);
remove(settings, logger);
}
@ -32,7 +35,7 @@ export default function pluginRemove(program) {
)
.option(
'-d, --plugin-dir <path>',
'path to the directory where plugins are stored',
'path to the directory where plugins are stored (DEPRECATED, known to not work for all plugins)',
fromRoot('plugins')
)
.description('remove a plugin',