`find` command uses GNUisms, causing issues in FreeBSD (& presumably other non-Linux OSes)
I ran into this issue while running Pylon in FreeBSD:
Process terminated with code 1, find: illegal option -- O
I couldn't narrow down the root cause upon a (somewhat) quick check, and fortunately, a workaround exists (install gfind, and then ln -s /usr/local/bin/gfind ~/.local/bin/find).
Still, I figured I might as well bring this up.
in which line is this executed?
That's the part I couldn't find. But since you seem interested, I can try giving it another go.
Seems to happen when the client connects.
what does git grep says?
FOUND IT!
https://github.com/pylonide/pylon/blob/master/plugins-server/pylon.ide.filelist/filelist.js#L91
Note that FreeBSD also has the -E option for find, so you can also add that platform to the list.
A more reliable way might be to run find --version --- gfind will yield a result, whereas FreeBSD's will error out. Not sure about Darwin's, but even if it doesn't error out, you should be able to parse the version.
Or --- this is hacky, but should be even more reliable --- you use something akin to find -O3 $APPDIR/test (replace $APPDIR/test with any nearly-empty[^1] directory, in this case, you'd probably make it in JS anyway) ... any errors here means it's either not GNU Find, or the system is horribly broken anyway.
[^1]: Nearly-empty for performance reasons; it otherwise technically doesn't matter, as long as find doesn't run into any "permission denied" problems or such.