From d364f0ba8c64cb7fe8a5a17b3d4384cb534024eb Mon Sep 17 00:00:00 2001 From: Georgios Andrianakis Date: Fri, 24 Apr 2020 12:12:42 +0300 Subject: [PATCH] Fix issue with .env file and workingDir property Fixes: #8812 --- .../main/java/io/quarkus/deployment/dev/DevModeMain.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/deployment/src/main/java/io/quarkus/deployment/dev/DevModeMain.java b/core/deployment/src/main/java/io/quarkus/deployment/dev/DevModeMain.java index d6de785bf0635..bd012f6f83af1 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/dev/DevModeMain.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/dev/DevModeMain.java @@ -131,6 +131,12 @@ private void copyDotEnvFile() { return; } Path currentDir = Paths.get("").toAbsolutePath().normalize(); + if (projectDir.toPath().equals(currentDir)) { + // the current directory is the same as the project directory so there is no need to copy the file as it's already in the proper location + // see https://github.com/quarkusio/quarkus/issues/8812 + return; + } + Path dotEnvPath = projectDir.toPath().resolve(".env"); if (Files.exists(dotEnvPath)) { try {