mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-09 07:25:46 +01:00
feat: add ./nodebb install <plugin_name>
will install the suggested version for current nodebb closes #11060
This commit is contained in:
@@ -87,6 +87,15 @@ module.exports = function (Plugins) {
|
||||
throw new Error('[[error:plugin-not-whitelisted]]');
|
||||
};
|
||||
|
||||
Plugins.suggest = async function (pluginId, nbbVersion) {
|
||||
const body = await request({
|
||||
method: 'GET',
|
||||
url: `https://packages.nodebb.org/api/v1/suggest?package=${encodeURIComponent(pluginId)}&version=${encodeURIComponent(nbbVersion)}`,
|
||||
json: true,
|
||||
});
|
||||
return body;
|
||||
};
|
||||
|
||||
Plugins.toggleInstall = async function (id, version) {
|
||||
pubsub.publish('plugins:toggleInstall', { hostname: os.hostname(), id: id, version: version });
|
||||
return await toggleInstall(id, version);
|
||||
|
||||
Reference in New Issue
Block a user