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

Missing is_symlink check? #9

Open
wooster0 opened this issue Jun 22, 2021 · 4 comments
Open

Missing is_symlink check? #9

wooster0 opened this issue Jun 22, 2021 · 4 comments

Comments

@wooster0
Copy link
Contributor

This is is_executable of is_executable: https://github.com/fitzgen/is_executable/blob/master/src/lib.rs#L90-L97
This is is_executable of nushell: https://github.com/nushell/nushell/blob/b39dda05500d92b627685b8251bfe416dc621c08/crates/nu-completion/src/command.rs#L73-L86
If you compare them you will notice that nushell has an additional is_symlink() check but is_executable's is_executable does not. Is this intentional or is there potentially an unintended omission?

@waywardmonkeys
Copy link

@fitzgen I'd be happy to submit a PR for this if you agree that it should check for being a symlink. But perhaps it should check to see if the symlink target exists and is a file?

@waywardmonkeys
Copy link

Looking further, the std::fs::metadata already should be peeking at the target file, not the actual symlink itself.

@waywardmonkeys
Copy link

@fitzgen
Copy link
Owner

fitzgen commented Jul 6, 2021

For my usecase when I wrote this crate, I would have been fine with following symlinks and essentially answering whether the thing that the symlink points to was executable or not. I realize that may or may not be what other users want. Maybe makes sense to have it configurable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants