diff --git a/cli/src/main/java/com/devonfw/tools/ide/commandlet/EnvironmentCommandlet.java b/cli/src/main/java/com/devonfw/tools/ide/commandlet/EnvironmentCommandlet.java index fc497817a..5496067fc 100644 --- a/cli/src/main/java/com/devonfw/tools/ide/commandlet/EnvironmentCommandlet.java +++ b/cli/src/main/java/com/devonfw/tools/ide/commandlet/EnvironmentCommandlet.java @@ -47,6 +47,8 @@ public void run() { if (this.context.getSystemInfo().isWindows()) { line = normalizeWindowsValue(line); } + String lineValue = "\"" + line.getValue() + "\""; + line = line.withValue(lineValue); this.context.info(line.toString()); } } diff --git a/cli/src/test/java/com/devonfw/tools/ide/commandlet/EnvironmentCommandletTest.java b/cli/src/test/java/com/devonfw/tools/ide/commandlet/EnvironmentCommandletTest.java index b66687777..5dad97f3e 100644 --- a/cli/src/test/java/com/devonfw/tools/ide/commandlet/EnvironmentCommandletTest.java +++ b/cli/src/test/java/com/devonfw/tools/ide/commandlet/EnvironmentCommandletTest.java @@ -79,15 +79,15 @@ public void testRun() { // act env.run(); // assert - assertLogMessage(context, IdeLogLevel.INFO, "MVN_VERSION=3.9.*"); - assertLogMessage(context, IdeLogLevel.INFO, "SOME=some-${UNDEFINED}"); - assertLogMessage(context, IdeLogLevel.INFO, "BAR=bar-some-${UNDEFINED}"); - assertLogMessage(context, IdeLogLevel.INFO, "IDE_TOOLS=mvn,eclipse"); - assertLogMessage(context, IdeLogLevel.INFO, "ECLIPSE_VERSION=2023-03"); - assertLogMessage(context, IdeLogLevel.INFO, "FOO=foo-bar-some-${UNDEFINED}"); - assertLogMessage(context, IdeLogLevel.INFO, "JAVA_VERSION=17*"); - assertLogMessage(context, IdeLogLevel.INFO, "INTELLIJ_EDITION=ultimate"); - assertLogMessage(context, IdeLogLevel.INFO, "DOCKER_EDITION=docker"); + assertLogMessage(context, IdeLogLevel.INFO, "MVN_VERSION=\"3.9.*\""); + assertLogMessage(context, IdeLogLevel.INFO, "SOME=\"some-${UNDEFINED}\""); + assertLogMessage(context, IdeLogLevel.INFO, "BAR=\"bar-some-${UNDEFINED}\""); + assertLogMessage(context, IdeLogLevel.INFO, "IDE_TOOLS=\"mvn,eclipse\""); + assertLogMessage(context, IdeLogLevel.INFO, "ECLIPSE_VERSION=\"2023-03\""); + assertLogMessage(context, IdeLogLevel.INFO, "FOO=\"foo-bar-some-${UNDEFINED}\""); + assertLogMessage(context, IdeLogLevel.INFO, "JAVA_VERSION=\"17*\""); + assertLogMessage(context, IdeLogLevel.INFO, "INTELLIJ_EDITION=\"ultimate\""); + assertLogMessage(context, IdeLogLevel.INFO, "DOCKER_EDITION=\"docker\""); } /**