[skip ci] fix installation direnv
This commit is contained in:
parent
81f16cbbc1
commit
c1e3bfbd41
2 changed files with 10 additions and 4 deletions
src/main
|
@ -164,12 +164,18 @@ fun Prov.installTerraform() = task {
|
||||||
|
|
||||||
fun Prov.installDirenv() = taskWithResult {
|
fun Prov.installDirenv() = taskWithResult {
|
||||||
val bashConfigFile = "~/.bashrc.d/direnv.sh"
|
val bashConfigFile = "~/.bashrc.d/direnv.sh"
|
||||||
|
|
||||||
if (!checkFile(bashConfigFile) && !checkPackage("direnv")) {
|
if (!checkFile(bashConfigFile) && !checkPackage("direnv")) {
|
||||||
aptInstall("direnv")
|
aptInstall("direnv")
|
||||||
val content = """eval "$(direnv hook bash)" """.trim() + "\n"
|
val content = """eval "$(direnv hook bash)" """.trim() + "\n"
|
||||||
createFile(bashConfigFile, content)
|
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 {
|
} 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")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
0.40.1-SNAPSHOT
|
0.40.2-SNAPSHOT
|
Loading…
Reference in a new issue