Also try to load cli options locally

This commit is contained in:
Peter Hedenskog 2025-03-02 16:34:24 +01:00
parent 2cd75d772c
commit 8dfad3b912
1 changed files with 10 additions and 0 deletions

View File

@ -16,6 +16,16 @@ export async function registerPluginOptions(yargsInstance, plugins) {
if (plugin && typeof plugin.getCliOptions === 'function') {
const options = plugin.getCliOptions();
yargsInstance.options(options);
} else {
try {
const plugin = await import(pluginName);
if (plugin && typeof plugin.getCliOptions === 'function') {
const options = plugin.getCliOptions();
yargsInstance.options(options);
}
} catch {
// Swallow this silent
}
}
} catch {
// Swallow this silent