yyx990803 / launch-editor

Open file in editor from Node.js.
MIT License
585 stars 67 forks source link

fix: strict exact match of macOS process #66

Closed chika3742 closed 5 months ago

chika3742 commented 10 months ago

This PR fixes a problem in which the search is not strictly an exact match in the part that searches for processes with an exact match.

In case running processes includes /Users/foo/Applications/IntelliJ IDEA.app/Contents/MacOS/idea, the original code will match this as well, since COMMON_EDITORS_OSX contains /Applications/IntelliJ IDEA.app/Contents/MacOS/idea. This prevents finding editor installation not in /Applications, such as /Users/foo/Applications/**.

I addressed this by doing an exact match search on a \n separated list of output string.

This fixes #52.

greg2451 commented 7 months ago

Hey, I can confirm I tested that fix locally and it works. @sodatea would it be possible to merge that?