Skip to content

Commit

Permalink
#652: properly report step success/error (#666)
Browse files Browse the repository at this point in the history
  • Loading branch information
hohwille authored Sep 30, 2024
1 parent 42201ed commit 55ea991
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,14 @@ public void installPlugin(ToolPluginDescriptor plugin, Step step) {
if (result.isSuccessful()) {
for (String line : result.getOut()) {
if (line.contains("Overall install request is satisfiable")) {
step.success();
return;
}
}
}
this.context.error("Failed to install plugin {} ({}): exit code was {}", plugin.name(), plugin.id(), result.getExitCode());
log(IdeLogLevel.DEBUG, result.getOut());
log(IdeLogLevel.ERROR, result.getErr());
step.error("Failed to install plugin {} ({}): exit code was {}", plugin.name(), plugin.id(), result.getExitCode());
}

private void log(IdeLogLevel level, List<String> lines) {
Expand Down
3 changes: 2 additions & 1 deletion cli/src/main/java/com/devonfw/tools/ide/tool/mvn/Mvn.java
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,9 @@ public void installPlugin(ToolPluginDescriptor plugin, Step step) {

if (Files.exists(mavenPlugin)) {
this.context.success("Successfully added {} to {}", plugin.name(), mavenPlugin.toString());
step.success();
} else {
this.context.warning("Plugin {} has wrong properties\n" //
step.error("Plugin {} has wrong properties\n" //
+ "Please check the plugin properties file in {}", mavenPlugin.getFileName(), mavenPlugin.toAbsolutePath());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@ public ExamplePluginBasedCommandlet(IdeContext context, String tool, Set<Tag> ta
@Override
public void installPlugin(ToolPluginDescriptor plugin, Step step) {

step.success();
}
}

0 comments on commit 55ea991

Please sign in to comment.