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

Only show available editors with correct path in list #40

Closed
simeg opened this issue Jan 7, 2019 · 4 comments
Closed

Only show available editors with correct path in list #40

simeg opened this issue Jan 7, 2019 · 4 comments

Comments

@simeg
Copy link
Owner

simeg commented Jan 7, 2019

Background
(#38, #39)
This project is written for macOS (because me, the author, uses a Mac) but not every user uses macOS. On Ubuntu the path to nano is different from macOS.

Proposed solution
Before showing the user the list of editors, we should "query" the system to see what binaries are available at what locations.

Note: If the command which [editor] returns 0 we can 1) know that the binary exists on the system, and 2) we get the path. So which would be a good command for this.

@iamaamir
Copy link

iamaamir commented Jan 9, 2019

which returns the pathnames of the files (or links) and It does this by searching the PATH, you could search the $PATH and then walk the dirs to.

another trick could be just run the command with -v if we got back something meaning command is present.

or the better is to use a crate

@simeg
Copy link
Owner Author

simeg commented Jan 9, 2019

Yeah, we could search the PATH directly.

Ideally I wouldn't want to add a dependency for this, but because it's cross-platform I think I'd be OK with it. I have no idea how the rest of this tool works on Windows though.

@iamaamir
Copy link

iamaamir commented Jan 10, 2019

these tools are *nix olny so it would be better to use a crate

@simeg
Copy link
Owner Author

simeg commented Jun 9, 2020

Redundant after #36

@simeg simeg closed this as completed Jun 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants