joy icon indicating copy to clipboard operation
joy copied to clipboard

Check for existence of entr before invoking

Open cpjolicoeur opened this issue 1 year ago • 6 comments

This will remove the "TODO" not and first check if entr is available for use

cpjolicoeur avatar Aug 18 '22 15:08 cpjolicoeur

Hm I think the build failures might be related to spork somehow, will have to check that out. Other than that, this is great! Always good to knock down todos

swlkr avatar Aug 18 '22 23:08 swlkr

Hm I think the build failures might be related to spork somehow, will have to check that out. Other than that, this is great! Always good to knock down todos

Yeah, quite a few pieces of need need to/should be updated to their spork counterparts.

I haven’t gone through all of it yet to update all the places enough to submit a formal PR

cpjolicoeur avatar Aug 18 '22 23:08 cpjolicoeur

Using which is not portable, if you want to use the shell for that use command -v.
That would be the POSIX compliant way.

tionis avatar Aug 22 '22 20:08 tionis

@tionis thanks for the heads up on that. I've updated the commit accordingly

cpjolicoeur avatar Aug 22 '22 20:08 cpjolicoeur

While this is better I still don't think it's a good idea to rely on the shell here, reduces cross compatibility.
I don't have any better Idea though at the moment (we could just execute entr without arguments and see if it fails), using the watchful library and doing it in janet might be possible but a bit overkill

tionis avatar Aug 23 '22 17:08 tionis

I'd be more than happy to have another solution, if a better one presents itself. My thoughts/concerns were to remove the current hard expectation that entr be available on a users machine, since right now there is no check at all.

cpjolicoeur avatar Aug 23 '22 18:08 cpjolicoeur