Fix loading plugin help (#4463)

This commit is contained in:
Peter Hedenskog 2025-03-05 17:55:58 +01:00 committed by GitHub
parent 9b8b40c570
commit 201fb8b62b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -11,14 +11,14 @@ export async function registerPluginOptions(yargsInstance, plugins) {
for (const pluginName of plugins) {
try {
// Dynamically import the plugin
const plugin = await importGlobalSilent(pluginName);
let { default: plugin } = await importGlobalSilent(pluginName);
// If the plugin exports a function to get CLI options, merge them
if (plugin && typeof plugin.getCliOptions === 'function') {
const options = plugin.getCliOptions();
yargsInstance.options(options);
} else {
try {
const plugin = await import(pluginName);
const { default: plugin } = await import(pluginName);
if (plugin && typeof plugin.getCliOptions === 'function') {
const options = plugin.getCliOptions();
yargsInstance.options(options);