Install and use locally in pre-commit #496
Unanswered
troywweber7
asked this question in
General
Replies: 3 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. |
0 replies
|
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. |
0 replies
|
How about npx? npm caches packages, re-runs are usually faster. npx zx ./script.mjs |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
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/.binto 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?All reactions