Skip to content

Commit

Permalink
Add message when no plugins found with tns plugin find
Browse files Browse the repository at this point in the history
When there are no plugins found with tns plugin find/search command the cli should show message for no plugins found instead of showing empty table with headers.
  • Loading branch information
TsvetanMilanov committed Apr 7, 2016
1 parent b67842e commit 1d9e77b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/commands/plugin/find-plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ export class FindPluginsCommand implements ICommand {
this.$progressIndicator.showProgressIndicator(pluginsFuture, 500).wait();
let plugins: IDictionary<any> = pluginsFuture.get();

this.$logger.out("Available NativeScript plugins");
this.showPlugins(plugins).wait();
}).future<void>()();
}
Expand All @@ -43,6 +42,11 @@ export class FindPluginsCommand implements ICommand {
return (() => {
let allPluginsNames: string[] = _.keys(plugins).sort();

if (!allPluginsNames || !allPluginsNames.length) {
this.$logger.warn("No plugins found.");
return;
}

let count: number = this.$options.count || FindPluginsCommand.COUNT_OF_PLUGINS_TO_DISPLAY;

if (!isInteractive() || this.$options.all) {
Expand All @@ -54,6 +58,8 @@ export class FindPluginsCommand implements ICommand {
let pluginsToDisplay: string[] = allPluginsNames.splice(0, count);
let shouldDisplayMorePlugins: boolean = true;

this.$logger.out("Available NativeScript plugins");

do {
data = this.createTableCells(plugins, pluginsToDisplay);

Expand Down

0 comments on commit 1d9e77b

Please sign in to comment.