Skip to content

Commit 556a8a3

Browse files
committed
cont self-update fix
1 parent 73cb1e7 commit 556a8a3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/kotlin/kscript/app/Kscript.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,16 +74,16 @@ fun main(args: Array<String>) {
7474
// optionally self-update kscript ot the newest version
7575
// (if not local copy is not being maintained by sdkman)
7676
if (docopt.getBoolean(("self-update"))) {
77-
if (evalBash("which kscript | grep .sdkman").stdout.isNotBlank()) {
77+
if (true || evalBash("which kscript | grep .sdkman").stdout.isNotBlank()) {
7878
info("Installing latest version of kscript...")
7979
// println("sdkman_auto_answer=true && sdk install kscript")
8080

8181
// create update script
8282
val updateScript = File(KSCRIPT_CACHE_DIR, "self_update.sh").apply {
8383
writeText("""
8484
#!/usr/bin/env bash
85-
# source ${"$"}{HOME}/.bash_profile
86-
# sdk --help
85+
export SDKMAN_DIR="${"$"}{HOME}/.sdkman"
86+
source "${"$"}{SDKMAN_DIR}/bin/sdkman-init.sh"
8787
sdkman_auto_answer=true && sdk install kscript
8888
""".trimIndent())
8989
setExecutable(true)

0 commit comments

Comments
 (0)