-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds ability to list installed plugins from CLI #5920
Conversation
Looks like there's something funky going on here, the PR includes 3 commits that are already in master. |
@@ -0,0 +1,18 @@ | |||
const fs = require('fs'); | |||
|
|||
module.exports = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use an es6 export instead of commonjs, so:
export function list(settings, logger) {
instead of module.exports = {...}
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, will make this change in this file. Should I also make the same change in the other plugin_*.js
files in this directory (that aren't in the scope of this PR)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to modify the other files. We plan to run through the entire codebase before Kibana 5 to update the majority of the existing commonjs module stuff.
Bunch of bits of feedback there, most of which are stylistic. The only bug I found was the conditional check for multiple commands at once. |
++numChosen; | ||
} | ||
}); | ||
return (numChosen > 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd recommend doing this by checking the length of the intersection rather than imperatively counting the duplicates. You can import intersection
from the lodash
module, and then this function becomes:
function areMultipleOptionsChosen(options, choices) {
return intersection(Object.keys(options), choices).length > 1;
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Beautiful. Changing. Thanks!
I've tested this out and it works well. My latest round of feedback is all stylistic recommendations rather than blockers, so this LGTM. |
@ycombinator Just assign this issue to me when you've addressed whatever feedback you want to address. |
@@ -1,5 +1,6 @@ | |||
const { resolve } = require('path'); | |||
const expiry = require('expiry-js'); | |||
import intersection from 'lodash'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should actually be import { intersection } from 'lodash';
The current line should error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correction, the current line itself wouldn't error, however intersection
would be the lodash constructor itself rather than the intersection
function from within lodash.
Adds ability to list installed plugins from CLI
Awesome, thanks for doing this! |
Closes #5916
Note: The code in this PR only goes as far as listing the names of the installed plugins. It does not list their version numbers. Please let me know if that's something worth adding.