diff --git a/dough-fs/src/jsMain/kotlin/gay/pizza/dough/fs/NodePath.kt b/dough-fs/src/jsMain/kotlin/gay/pizza/dough/fs/NodePath.kt index 6f5d27e..8211313 100644 --- a/dough-fs/src/jsMain/kotlin/gay/pizza/dough/fs/NodePath.kt +++ b/dough-fs/src/jsMain/kotlin/gay/pizza/dough/fs/NodePath.kt @@ -2,7 +2,9 @@ package gay.pizza.dough.fs import gay.pizza.dough.fs.nodefs.NodePathModule -class NodePath(override val fullPathString: String) : FsPath { +class NodePath(fullPathString: String) : FsPath { + override val fullPathString: String = NodePathModule.resolve(fullPathString) + override val entityNameString: String get() = NodePathModule.baseName(fullPathString) override val parent: FsPath diff --git a/dough-fs/src/jsMain/kotlin/gay/pizza/dough/fs/NodejsFsProvider.kt b/dough-fs/src/jsMain/kotlin/gay/pizza/dough/fs/NodejsFsProvider.kt index b5dc1b2..0773e40 100644 --- a/dough-fs/src/jsMain/kotlin/gay/pizza/dough/fs/NodejsFsProvider.kt +++ b/dough-fs/src/jsMain/kotlin/gay/pizza/dough/fs/NodejsFsProvider.kt @@ -1,13 +1,10 @@ package gay.pizza.dough.fs -import gay.pizza.dough.fs.nodefs.NodePathModule - object NodejsFsProvider : FsProvider { override val currentWorkingDirectory: FsPath - get() = NodePath(NodePathModule.resolve(".")) + get() = NodePath(".") - override val operations: FsOperations - get() = TODO() + override val operations: FsOperations = NodeFsOperations - override fun resolve(path: String): FsPath = NodePath(NodePathModule.resolve(path)) + override fun resolve(path: String): FsPath = NodePath(path) } diff --git a/dough-fs/src/jvmMain/kotlin/gay/pizza/dough/fs/JavaPath.kt b/dough-fs/src/jvmMain/kotlin/gay/pizza/dough/fs/JavaPath.kt index b1474d6..577c271 100644 --- a/dough-fs/src/jvmMain/kotlin/gay/pizza/dough/fs/JavaPath.kt +++ b/dough-fs/src/jvmMain/kotlin/gay/pizza/dough/fs/JavaPath.kt @@ -4,7 +4,9 @@ import java.nio.file.Path import java.util.* import kotlin.io.path.relativeTo -class JavaPath(val javaPath: Path) : FsPath { +class JavaPath(path: Path) : FsPath { + val javaPath: Path = path.toAbsolutePath() + override val fullPathString: String get() = javaPath.toString()