mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[plugin installer] Use find instead of some when looking for path
This commit is contained in:
parent
9be15fb7b9
commit
3ce2c5ffe7
1 changed files with 4 additions and 4 deletions
|
@ -4,6 +4,7 @@ import install from './install';
|
|||
import Logger from '../lib/logger';
|
||||
import pkg from '../../utils/package_json';
|
||||
import { parse, parseMilliseconds } from './settings';
|
||||
import { find } from 'lodash';
|
||||
|
||||
function processCommand(command, options) {
|
||||
let settings;
|
||||
|
@ -25,17 +26,16 @@ function getDefaultConfigPath() {
|
|||
'/etc/kibana/kibana.yml'
|
||||
];
|
||||
|
||||
let defaultPath = paths[0];
|
||||
paths.some(configPath => {
|
||||
const availablePath = find(paths, configPath => {
|
||||
try {
|
||||
fs.accessSync(configPath, fs.R_OK);
|
||||
defaultPath = configPath;
|
||||
return true;
|
||||
} catch (e) {
|
||||
//Check the next path
|
||||
}
|
||||
});
|
||||
return defaultPath;
|
||||
|
||||
return availablePath || paths[0];
|
||||
}
|
||||
|
||||
export default function pluginInstall(program) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue