From 33ec0fa52d8c4ad73b88ddf922a926cb779d837a Mon Sep 17 00:00:00 2001 From: Ioannis Canellos Date: Tue, 29 Aug 2023 20:03:31 +0300 Subject: [PATCH] chore: avoid uneeded use of jbang in plugin commands --- .../java/io/quarkus/cli/plugin/JBangCatalogService.java | 9 +++++++-- .../java/io/quarkus/cli/plugin/PluginMangerState.java | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/independent-projects/tools/devtools-common/src/main/java/io/quarkus/cli/plugin/JBangCatalogService.java b/independent-projects/tools/devtools-common/src/main/java/io/quarkus/cli/plugin/JBangCatalogService.java index c28ce62985983..ea2f6b78ccef0 100644 --- a/independent-projects/tools/devtools-common/src/main/java/io/quarkus/cli/plugin/JBangCatalogService.java +++ b/independent-projects/tools/devtools-common/src/main/java/io/quarkus/cli/plugin/JBangCatalogService.java @@ -40,6 +40,10 @@ public JBangCatalogService(boolean interactiveMode, MessageWriter output, String this.jbang = new JBangSupport(interactiveMode, output); } + public boolean ensureJBangIsInstalled() { + return jbang.ensureJBangIsInstalled(); + } + @Override public JBangCatalog readCatalog(Path path) { if (!jbang.isAvailable() && !jbang.isInstallable()) { @@ -93,8 +97,9 @@ public JBangCatalog readCombinedCatalog(Optional projectDir, Optional !aliases.containsKey(e.getKey())) diff --git a/independent-projects/tools/devtools-common/src/main/java/io/quarkus/cli/plugin/PluginMangerState.java b/independent-projects/tools/devtools-common/src/main/java/io/quarkus/cli/plugin/PluginMangerState.java index f983ef6f7e02f..3e5f0c2573491 100644 --- a/independent-projects/tools/devtools-common/src/main/java/io/quarkus/cli/plugin/PluginMangerState.java +++ b/independent-projects/tools/devtools-common/src/main/java/io/quarkus/cli/plugin/PluginMangerState.java @@ -141,6 +141,7 @@ public Map getInstallablePlugins() { public Map jbangPlugins() { boolean isUserScoped = !projectRoot.isPresent(); Map jbangPlugins = new HashMap<>(); + jbangCatalogService.ensureJBangIsInstalled(); JBangCatalog jbangCatalog = jbangCatalogService.readCombinedCatalog(projectRoot, userHome); jbangCatalog.getAliases().forEach((location, alias) -> { String name = util.getName(location);