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