Skip to content

Commit 1d9e77b

Browse files
Add message when no plugins found with tns plugin find
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.
1 parent b67842e commit 1d9e77b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/commands/plugin/find-plugins.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ export class FindPluginsCommand implements ICommand {
2828
this.$progressIndicator.showProgressIndicator(pluginsFuture, 500).wait();
2929
let plugins: IDictionary<any> = pluginsFuture.get();
3030

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

45+
if (!allPluginsNames || !allPluginsNames.length) {
46+
this.$logger.warn("No plugins found.");
47+
return;
48+
}
49+
4650
let count: number = this.$options.count || FindPluginsCommand.COUNT_OF_PLUGINS_TO_DISPLAY;
4751

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

61+
this.$logger.out("Available NativeScript plugins");
62+
5763
do {
5864
data = this.createTableCells(plugins, pluginsToDisplay);
5965

0 commit comments

Comments
 (0)