Closed loreanvictor closed 1 year ago
I think it'll be wise to first implement the second fix, since:
As for the first solution, a few questions need to be answered first:
I will close this issue for now, since removing folders by explicitly mentioning them seems to cover necessary use cases. If another use case comes up in the future, then this issue can be re-opened.
After adding support for glob patterns to remove command, the remove command can't remove folders (sandbox).
This is because
NodeFS.ls()
only lists files and not folders. It does that, because update and copy commands can't semantically copy folders.Potential remedies are:
Adding an optional argument to
filesystem.ls()
to also list folders, update the implementation onNodeFS
, and have the remove command use this option:This would mean that the remove command would also affect folders unlike copy and update commands, which can be confusing for users when using glob patterns in combination with the remove command. This confusion can be handled by adding an optional argument to remove itself to determine whether it should target directories or not.
Changing implementation of the remove command, so that when no glob pattern is passed, it will remove folders properly.
This bug was first identified by @tommy-mitchel here.