Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion: fs-dirname should support non-existing paths #153

Open
balupton opened this issue May 3, 2022 · 3 comments
Open

Suggestion: fs-dirname should support non-existing paths #153

balupton opened this issue May 3, 2022 · 3 comments
Labels
enhancement Improvement or suggestion PR / Bounty only External demand, as such, external funding / effort is required to make this happen

Comments

@balupton
Copy link
Member

balupton commented May 3, 2022

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.

@balupton balupton added this to the Public Launch milestone May 3, 2022
@balupton balupton removed this from the Public Launch milestone Sep 7, 2022
@balupton
Copy link
Member Author

fs-absolute also requires existing paths

@balupton balupton changed the title fs-dirname should support non-existing paths Suggestion: fs-dirname should support non-existing paths Sep 1, 2023
@balupton
Copy link
Member Author

balupton commented Sep 1, 2023

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 .

@balupton balupton added the enhancement Improvement or suggestion label Sep 1, 2023
@balupton balupton added the PR / Bounty only External demand, as such, external funding / effort is required to make this happen label Oct 17, 2024
@balupton
Copy link
Member Author

I'm never going to get around this. So marking as available for someone else to have a go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvement or suggestion PR / Bounty only External demand, as such, external funding / effort is required to make this happen
Development

No branches or pull requests

1 participant