From c1e3bfbd4188c090a5b3f29fea92d83953d9471b Mon Sep 17 00:00:00 2001
From: ansgarz <ansgar.zwick@meissa.de>
Date: Tue, 25 Feb 2025 21:15:06 +0100
Subject: [PATCH] [skip ci] fix installation direnv

---
 .../provs/desktop/infrastructure/DevOps.kt           | 12 +++++++++---
 src/main/resources/version.txt                       |  2 +-
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/src/main/kotlin/org/domaindrivenarchitecture/provs/desktop/infrastructure/DevOps.kt b/src/main/kotlin/org/domaindrivenarchitecture/provs/desktop/infrastructure/DevOps.kt
index 45a9d21..acc5258 100644
--- a/src/main/kotlin/org/domaindrivenarchitecture/provs/desktop/infrastructure/DevOps.kt
+++ b/src/main/kotlin/org/domaindrivenarchitecture/provs/desktop/infrastructure/DevOps.kt
@@ -164,12 +164,18 @@ fun Prov.installTerraform() = task {
 
 fun Prov.installDirenv() = taskWithResult {
     val bashConfigFile = "~/.bashrc.d/direnv.sh"
+
     if (!checkFile(bashConfigFile) && !checkPackage("direnv")) {
         aptInstall("direnv")
         val content = """eval "$(direnv hook bash)" """.trim() + "\n"
         createFile(bashConfigFile, content)
-        addResult(checkPackage("direnv"), info = "direnv has been installed.")
+
+        if (checkPackage("direnv")) {
+            ProvResult(true, info = "direnv has been installed.")
+        } else {
+            ProvResult(false, info = "direnv has not been installed successfully.")
+        }
     } else {
-        return@taskWithResult ProvResult(true, info = "direnv or ~/.bashrc.d/direnv.sh already installed")
+        ProvResult(true, info = "direnv or ~/.bashrc.d/direnv.sh are already installed")
     }
-}
\ No newline at end of file
+}
diff --git a/src/main/resources/version.txt b/src/main/resources/version.txt
index 981e7db..caaa40b 100644
--- a/src/main/resources/version.txt
+++ b/src/main/resources/version.txt
@@ -1 +1 @@
-0.40.1-SNAPSHOT
\ No newline at end of file
+0.40.2-SNAPSHOT
\ No newline at end of file