fix import paths

This commit is contained in:
Irmen de Jong 2021-04-30 00:16:36 +02:00
parent d906fcea0e
commit d5214e2505

View File

@ -158,8 +158,8 @@ class ModuleImporter(val program: Program, val encoder: IStringEncoding, val com
val fileName = "$name.p8" val fileName = "$name.p8"
val libpaths = libdirs.map {Path.of(it)} val libpaths = libdirs.map {Path.of(it)}
val locations = val locations =
(if(source.toString().isEmpty()) libpaths else libpaths.drop(1) + (source.parent ?: Path.of("."))) + (if(source.toString().isEmpty()) libpaths else libpaths.drop(1) + listOf(source.parent ?: Path.of("."))) +
Paths.get(Paths.get("").toAbsolutePath().toString(), "prog8lib") listOf(Paths.get(Paths.get("").toAbsolutePath().toString(), "prog8lib"))
locations.forEach { locations.forEach {
val file = pathFrom(it.toString(), fileName) val file = pathFrom(it.toString(), fileName)