mirror of
https://github.com/GayPizzaSpecifications/dough.git
synced 2025-08-03 05:30:55 +00:00
Ensure absolute paths in NodeJS and JVM.
This commit is contained in:
@ -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
|
||||
|
@ -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)
|
||||
}
|
||||
|
@ -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()
|
||||
|
||||
|
Reference in New Issue
Block a user