From 75f5043e5279ccb9ee5bcdefaa76692bd8f13e75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Hohwiller?= Date: Thu, 12 Dec 2024 10:43:50 +0100 Subject: [PATCH] #875: fix lazydocker (#883) --- CHANGELOG.adoc | 1 + .../devonfw/tools/ide/tool/lazydocker/LazyDocker.java | 9 ++++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index b2a80209f..b2f12018e 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -26,6 +26,7 @@ Release with new features and bugfixes: * https://github.com/devonfw/IDEasy/issues/879[#879]: cannot omit default settings URL in ide create * https://github.com/devonfw/IDEasy/issues/758[#758]: Create status commandlet * https://github.com/devonfw/IDEasy/issues/824[#824]: ide create «settings-url»#«branch» not working +* https://github.com/devonfw/IDEasy/issues/875[#875]: lazydocker is not working * https://github.com/devonfw/IDEasy/issues/754[#754]: Again messages break processable command output * https://github.com/devonfw/IDEasy/issues/737[#739]: Improved error handling to show 'You are not inside an IDE installation' only when relevant. diff --git a/cli/src/main/java/com/devonfw/tools/ide/tool/lazydocker/LazyDocker.java b/cli/src/main/java/com/devonfw/tools/ide/tool/lazydocker/LazyDocker.java index bbd58458d..8c958415b 100644 --- a/cli/src/main/java/com/devonfw/tools/ide/tool/lazydocker/LazyDocker.java +++ b/cli/src/main/java/com/devonfw/tools/ide/tool/lazydocker/LazyDocker.java @@ -38,14 +38,13 @@ protected void installDependencies() { // TODO create lazydocker/lazydocker/dependencies.json file in ide-urls and delete this method getCommandlet(Docker.class).install(); // verify docker API version requirements - String bashPath = this.context.findBashRequired(); - ProcessContext pc = this.context.newProcess().errorHandling(ProcessErrorHandling.NONE).executable(bashPath) - .addArg("-c").addArg("docker").addArg("version").addArg("--format").addArg("'{{.Client.APIVersion}}'"); + ProcessContext pc = this.context.newProcess().errorHandling(ProcessErrorHandling.NONE).executable("docker") + .addArg("version").addArg("--format").addArg("'{{.Client.APIVersion}}'"); ProcessResult result = pc.run(ProcessMode.DEFAULT_CAPTURE); verifyDockerVersion(result, MIN_API_VERSION, "docker API"); // verify docker compose version requirements - pc = this.context.newProcess().errorHandling(ProcessErrorHandling.NONE).executable(bashPath).addArg("-c").addArg("docker-compose").addArg("version") + pc = this.context.newProcess().errorHandling(ProcessErrorHandling.NONE).executable("docker-compose").addArg("version") .addArg("--short"); result = pc.run(ProcessMode.DEFAULT_CAPTURE); verifyDockerVersion(result, MIN_COMPOSE_VERSION, "docker-compose"); @@ -54,7 +53,7 @@ protected void installDependencies() { private static void verifyDockerVersion(ProcessResult result, VersionIdentifier minimumVersion, String kind) { // we have this pattern a lot that we want to get a single line output of a successful ProcessResult. // we should create a generic method in ProcessResult for this use-case. - if (!result.isSuccessful() || result.getOut().isEmpty()) { + if (result.getOut().isEmpty()) { throw new CliException("Docker is not installed, but required for lazydocker.\n" // + "To install docker, call the following command:\n" // + "ide install docker");