Install and use locally in pre-commit #496
Replies: 2 comments
-
This is one viable solution, I think. I guess I want to check that this is what the library author's would recommend in my situation as well. If so, I'm satisfied with that. |
Beta Was this translation helpful? Give feedback.
-
One approach I actually ended up using was to use node in the shebang instead of zx. Of course this means giving up top level await because node doesn't yet have the ability to interpret an extensionless file as mjs no matter what you try. It also means you have to import things in a slightly odd manner, but it is doable. At some point I will post the pre-commit file I landed on in case it helps anyone else. |
Beta Was this translation helpful? Give feedback.
-
I'm struggling to use zx when installed locally. It seems I have to install it globally if I want to run it directly with
./pre-commit.mjs
. Or if I addnode_modules/.bin
to the path, then it works when I'm at the project root. Under.git/hooks
, however, that path change won't stick unless it was an absolute path. What is the best approach to this situation?Beta Was this translation helpful? Give feedback.
All reactions