Skip to content

Commit 18f0726

Browse files
jhby1jh-edstart
authored andcommitted
Make INCLUDE directive files relative to script dir
1 parent 8bf4a6d commit 18f0726

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,7 @@ fun prepareScript(scriptResource: String): Pair<File, URI> {
333333
// if we can "just" read from script resource create tmp file
334334
// i.e. script input is process substitution file handle
335335
// not FileInputStream(this).bufferedReader().use{ readText()} does not work nor does this.readText
336+
includeContext = this.absoluteFile.parentFile.toURI()
336337
createTmpScript(FileInputStream(this).bufferedReader().readText())
337338
}
338339
}

0 commit comments

Comments
 (0)