-
Notifications
You must be signed in to change notification settings - Fork 4
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
Feature/move plugins #31
Conversation
exports.ERR_MODULE_NOT_FOUND = 'ERR_MODULE_NOT_FOUND'; | ||
exports.ERR_MODULE_NOT_ENABLED = 'ERR_MODULE_NOT_ENABLED'; |
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.
Why not ERR_MODULE_DISABLED
?
* @param {String} plugin - The plugin name | ||
* @return {Boolean} | ||
*/ | ||
const isEnabled = plugin => getAll().indexOf(plugin) > -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 think this can be simplified
Boolean(~getAll().indexOf(plugin))
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.
Boolean()
seems unnecessary but NOT op LGTM. Will add this soon.
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.
@adnasa Not sure if you saw this.
Moving plugins-related functions into a separate module so it is more maintainable.
The new
plugins
module has a new methodenable()
, anddisable()
which encapsulates adding/removing the plugin from~/.dext/config.json
to enable resolving DextApp/dext#64. This method is accessible via:api.plugins.enable(plugin)
api.plugins.disable(plugin)
In addition,
createSymLink()
, andremoveSymLink()
will now enable and disable the plugin. This resolves vutran/dext-cli#21