feat: autocomplete for activate/reset

useless features™️
This commit is contained in:
Julian Lam
2021-11-22 15:37:32 -05:00
parent fdae69911b
commit f0d192fbfd
3 changed files with 15 additions and 2 deletions

View File

@@ -25,6 +25,9 @@ async function activate(plugin) {
// Allow omission of `nodebb-plugin-`
plugin = `nodebb-plugin-${plugin}`;
}
plugin = await plugins.autocomplete(plugin);
const isInstalled = await plugins.isInstalled(plugin);
if (!isInstalled) {
throw new Error('plugin not installed');

View File

@@ -25,6 +25,7 @@ exports.reset = async function (options) {
themeId = `nodebb-theme-${themeId}`;
}
themeId = await plugins.autocomplete(themeId);
await resetTheme(themeId);
}
},
@@ -38,6 +39,7 @@ exports.reset = async function (options) {
pluginId = `nodebb-plugin-${pluginId}`;
}
pluginId = await plugins.autocomplete(pluginId);
await resetPlugin(pluginId);
}
},