Skip to content

Commit

Permalink
fixed integration test update, refactored plugin list display
Browse files Browse the repository at this point in the history
Signed-off-by: jace-roell <[email protected]>
  • Loading branch information
jace-roell committed Jul 16, 2024
1 parent 7565b08 commit 82dbb3c
Showing 1 changed file with 21 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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`;
}
Expand All @@ -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.";
}
Expand Down

0 comments on commit 82dbb3c

Please sign in to comment.