Skip to content

Commit 2ca51dc

Browse files
committed
Create temporaru script using lazy (fixed #130)
1 parent 4d6d5b6 commit 2ca51dc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,10 @@ Website : https://github.com/holgerbrandl/kscript
5252
""".trim()
5353

5454
val KSCRIPT_CACHE_DIR = File(System.getenv("HOME")!!, ".kscript")
55-
val SCRIPT_TEMP_DIR = createTempDir()
55+
56+
// use lazy here prevent empty dirs for regular scripts https://github.com/holgerbrandl/kscript/issues/130
57+
val SCRIPT_TEMP_DIR by lazy { createTempDir() }
58+
5659

5760
fun main(args: Array<String>) {
5861
// skip org.docopt for version and help to allow for lazy version-check

0 commit comments

Comments
 (0)