mirror of
https://github.com/GayPizzaSpecifications/dough.git
synced 2025-08-05 06:21:32 +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
|
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
|
override val entityNameString: String
|
||||||
get() = NodePathModule.baseName(fullPathString)
|
get() = NodePathModule.baseName(fullPathString)
|
||||||
override val parent: FsPath
|
override val parent: FsPath
|
||||||
|
@ -1,13 +1,10 @@
|
|||||||
package gay.pizza.dough.fs
|
package gay.pizza.dough.fs
|
||||||
|
|
||||||
import gay.pizza.dough.fs.nodefs.NodePathModule
|
|
||||||
|
|
||||||
object NodejsFsProvider : FsProvider {
|
object NodejsFsProvider : FsProvider {
|
||||||
override val currentWorkingDirectory: FsPath
|
override val currentWorkingDirectory: FsPath
|
||||||
get() = NodePath(NodePathModule.resolve("."))
|
get() = NodePath(".")
|
||||||
|
|
||||||
override val operations: FsOperations
|
override val operations: FsOperations = NodeFsOperations
|
||||||
get() = TODO()
|
|
||||||
|
|
||||||
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 java.util.*
|
||||||
import kotlin.io.path.relativeTo
|
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
|
override val fullPathString: String
|
||||||
get() = javaPath.toString()
|
get() = javaPath.toString()
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user