noel-friedrich / terminal

Terminal-style Personal Homepage
https://noel-friedrich.de/terminal
MIT License
44 stars 7 forks source link

renaming current folder doesn't update currPath of terminal #5

Closed noel-friedrich closed 7 months ago

noel-friedrich commented 1 year ago

Commands entered:

[1] cd noel
[2] rename . xxx
[3] ls
> Error: File "" not found

Reason:

terminal.fileSystem.currPath == ["noel"]
// the property hasn't been updated when renaming!

Fix:

noel-friedrich commented 1 year ago

path now updated when renaming current folder. problem not fully solved as one may rename a higher order file, thus creating the same problem. fixable by looping through all path files and seeking matching file-ids?

noel-friedrich commented 1 year ago

possible solve: ostrich algorithm https://en.wikipedia.org/wiki/Ostrich_algorithm

noel-friedrich commented 7 months ago

solved finally by reworking the filepath saving: the terminal filesystem now only keeps track of parent node instead of a path.