evilmartians / lefthook

Fast and powerful Git hooks manager for any type of projects.
MIT License
4.99k stars 218 forks source link

Support OpenBSD #807

Closed neezer closed 3 months ago

neezer commented 3 months ago

:zap: Summary

Use lefthook... on OpenBSD!

Value

I could work on projects that incorporate lefthook... on OpenBSD!

Behavior and configuration changes

When I run npx lefthook install, I shouldn't get

Cannot find module 'lefthook-openbsd-x64/bin/lefthook'
neezer commented 3 months ago

Looks like it builds fine using make build. Gonna see if I can manually insert it into node_modules to try it out with my codebase...

make test fails because -race isn't supported with go test on OpenBSD, but removing that, the only other test failure is TestUpdater_SelfUpdate/success... because OpenBSD binaries aren't published.

FWIW

neezer commented 3 months ago

Modifying node_modules/lefthook/get-exec.js to point to my binary built using make build and things are behaving exactly as I'd expect so far, FYI.

I'll pipe down until someone else more familiar with the project chimes in. 😄

mrexox commented 3 months ago

Hey! Sounds good! I will add a build for OpenBSD :+1:

mrexox commented 3 months ago

Please, check if it works for you now

neezer commented 3 months ago

On the surface looks excellent, but after upgrading to 1.7.13, blasting my node_modules and re-installing with npm i, I still get

Error: Cannot find module 'lefthook-openbsd-x64/bin/lefthook'

Seems like npm i is not downloading the dependency for lefthook-openbsd-x64, as I only see node_modules/lefthook after npm i.

mrexox commented 3 months ago

Can you manually do npm i lefthook-openbsd-x64?

mrexox commented 3 months ago

Oh, it's because I forgot to add it as an optional dependency to the lefthook package. My bad, will fix next release.

neezer commented 2 months ago

Apologies for being late in following-up on this, but I tried out 1.7.14 (blasting node_modules first) and everything looks peachy keen. Thanks!