From 2d5417eafa3b964a4258e04439f36bddeda1aa03 Mon Sep 17 00:00:00 2001 From: Guillaume Smet Date: Thu, 26 Sep 2024 16:26:20 +0200 Subject: [PATCH] Quarkus Update - Replace \ by / in rewriteFile path on Windows Fixes #43473 --- .../project/update/rewrite/QuarkusUpdateCommand.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/project/update/rewrite/QuarkusUpdateCommand.java b/independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/project/update/rewrite/QuarkusUpdateCommand.java index 674bffe72d8cb4..54aac48c192e46 100644 --- a/independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/project/update/rewrite/QuarkusUpdateCommand.java +++ b/independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/project/update/rewrite/QuarkusUpdateCommand.java @@ -80,9 +80,15 @@ private static void runGradleUpdate(MessageWriter log, Path baseDir, String rewr new InputStreamReader(inputStream, StandardCharsets.UTF_8)) .lines() .collect(Collectors.joining("\n")); + + String rewriteFile = recipe.toAbsolutePath().toString(); + if (OS.WINDOWS.isCurrent()) { + rewriteFile = rewriteFile.replace('\\', '/'); + } + Files.writeString(tempInit, Qute.fmt(template, Map.of( - "rewriteFile", recipe.toAbsolutePath().toString(), + "rewriteFile", rewriteFile, "pluginVersion", rewritePluginVersion, "recipesGAV", recipesGAV, "activeRecipe", RECIPE_IO_QUARKUS_OPENREWRITE_QUARKUS,