textual-engine
textual-engine copied to clipboard
file loader cannot handle absolute paths
when loading a game/world, using the world's absolute file path will return an error:
{"name":"textual-engine","kind":"main","hostname":"medusa","pid":11587,"level":50,"err":{"message":"ENOENT: no such file or directory, open '/home/bzlibby/documents/textual-enginge/data/samples/hansel-and-gretel.yml'","name":"Error","stack":"Error: ENOENT: no such file or directory, open '/home/bzlibby/documents/textual-enginge/data/samples/hansel-and-gretel.yml'","code":"ENOENT"},"msg":"error during read","time":"2021-06-26T03:28:02.564Z","v":0}
steps to reproduce:
$ make run$ load file://<absolute path to world file>- see error message
$ load file://<relative path to world file>- see world load successfully
I am not able to reproduce this with a similar path or one with spaces:
turn 0 > load file:///home/ssube/code/ssube/text-adventure/data/samples/dracula.yml
no world states loaded from file:///home/ssube/code/ssube/text-adventure/data/samples/dracula.yml
turn 0 > worlds
test world (test)
Dracula (sample-dracula)
turn 0 > load file:///home/ssube/code/ssube/text-adventure/data/test samples/alice.yml
no world states loaded from file:///home/ssube/code/ssube/text-adventure/data/test samples/alice.yml
turn 0 > worlds
test world (test)
Dracula (sample-dracula)
Alice in Wonderland (sample-alice)