dorothy
dorothy copied to clipboard
Suggestion: `fs-dirname` should support non-existing paths
Right now it'll fail if the path does not exist, there are workarounds we can do.
Once achieved, we should replace as many dirname
calls with fs-dirname
, as dirname
has so many issues.
fs-absolute also requires existing paths
fs-dirname
is also such a misnomer, it should be fs-parent
if that is the intent
10:34:25:/Users/balupton/.local/share/dorothy:master
> dirname .
.
10:43:46:/Users/balupton/.local/share/dorothy:master
> dirname ..
.
10:43:52:/Users/balupton/.local/share/dorothy:master
> dirname $DOROTHY
/Users/balupton/.local/share
10:44:22:/Users/balupton/.local/share/dorothy:master
> dirname commands
.
10:44:29:/Users/balupton/.local/share/dorothy:master
> dirname (pwd)
/Users/balupton/.local/share
10:44:44:/Users/balupton/.local/share/dorothy:master
> dirname non/existent/path
non/existent
10:45:11:/Users/balupton/.local/share/dorothy:master
> dirname non/existent/path/
non/existent
10:45:12:/Users/balupton/.local/share/dorothy:master
> dirname commands/
.
10:45:17:/Users/balupton/.local/share/dorothy:master
> dirname (pwd)/commands/
/Users/balupton/.local/share/dorothy
dirname always returns parent directory, but if any relative path is provided, then it is fine returning .