From 82dbb3caf0f182cbc746f1c1750291d14cef76f9 Mon Sep 17 00:00:00 2001 From: jace-roell Date: Tue, 16 Jul 2024 11:34:11 -0400 Subject: [PATCH] fixed integration test update, refactored plugin list display Signed-off-by: jace-roell --- .../src/plugins/cmd/list/list.handler.ts | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/packages/imperative/src/imperative/src/plugins/cmd/list/list.handler.ts b/packages/imperative/src/imperative/src/plugins/cmd/list/list.handler.ts index b6fd5d2290..4d2bd581df 100644 --- a/packages/imperative/src/imperative/src/plugins/cmd/list/list.handler.ts +++ b/packages/imperative/src/imperative/src/plugins/cmd/list/list.handler.ts @@ -47,6 +47,9 @@ export default class ListHandler implements ICommandHandler { let listOutput: string = ""; let firstTime = true; + // Boolean to check if any of the plug-ins installed originate from Zowe Cli V2 + let containsLegacyPlugin: boolean = false; + for (const pluginName of Object.keys(installedPlugins).sort((a, b) => a.localeCompare(b))) { if (Object.prototype.hasOwnProperty.call(installedPlugins, pluginName)) { // Build the console output @@ -61,8 +64,19 @@ export default class ListHandler implements ICommandHandler { `${chalk.red.bold(installedPlugins[pluginName].package)} \n`; listOutput = listOutput + `${chalk.yellow.bold(" -- version: ")}` + `${chalk.red.bold(installedPlugins[pluginName].version)} \n`; - listOutput = listOutput + `${chalk.yellow.bold(" -- location: ")}` + - installedPlugins[pluginName].location + "\n\n"; + + if((installedPlugins[pluginName] as any).registry) + { + containsLegacyPlugin = true; + listOutput = listOutput + `${chalk.yellow.bold(" -- registry: ")}` + + `${chalk.red.bold((installedPlugins[pluginName] as any).registry)}` + + `${chalk.yellow.bold(" (?)")}` + "\n\n"; + } + else + { + listOutput = listOutput + `${chalk.yellow.bold(" -- location: ")}` + + `${chalk.red.bold(installedPlugins[pluginName].location)}` + "\n\n"; + } } else { listOutput += `${chalk.yellow(pluginName)}@${installedPlugins[pluginName].version}\n`; } @@ -82,6 +96,11 @@ export default class ListHandler implements ICommandHandler { } } + if(containsLegacyPlugin) + { + listOutput = listOutput + `${chalk.yellow.bold("Plug-ins marked with (?) may be invalid or out of date, and might need to be reinstalled.")}` + "\n"; + } + if (listOutput === "") { listOutput = "No plugins have been installed into your CLI application."; }