Skip to content

Why all this "find executable in PATH" goosery on non-Win32? #19

Description

@bengotow

Hey! I'm trying to debug an issue I'm having with electron-spellcheck. Essentially on both my Debian and Fedora test machines, this line is failing (https://github.com/electron-userland/electron-spellchecker/blob/master/src/spell-check-handler.js#L590). To make things worse, the following catch yields an Observable.of(null), which then causes the next line to throw an exception because it expects strings. (Cannot call split on "null")

Aaanyway - that brought me here to spawn-rx, which looks great. I'm trying to understand why await spawn('locale', ['-a']) would fail in the first place, since on both these machines it works on the Terminal.

It seems like spawn-rx is calling runDownPath on non-Win32 platforms (https://github.com/paulcbetts/spawn-rx/blob/master/src/index.ts#L96), which seems to go through a lot of trouble trying to find an executable on the PATH (stating around, etc.) and introduces a handful of places that might be the source of my headache. This seems like overkill, since the system would do this automatically if you just tried to run the command.

Haven't found the root cause yet, so this is mostly an observation—I think that call to runDownPath could probably be removed and only used on Windows? Will file appropriate issues when I figure out what's going.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions