3 Commits

Author SHA1 Message Date
jiarung
98822509a8 fix(git-hooks): pick newest nvm Node with version-aware sort
The previous loop used Bash glob expansion (lexicographic order) and
stopped at the first match, so environments with multiple Node installs
could select an older runtime (e.g. v18 before v22).

Extract the nvm resolution into a shared scripts/pre-commit/resolve-node.sh
that pipes `ls` output through `sort -V | tail -1` to select the
semantically newest version. Both pre-commit and run-node-tool.sh now
source the shared script, eliminating the duplicated logic.
2026-03-13 14:17:36 +00:00
jiarung
4ced2e0ef0 fix(git-hooks): resolve node binary for nvm environments
When git hooks run, the shell profile is not sourced so nvm-managed
Node installations are not in PATH. This caused 'node: command not
found' errors on every commit for users relying on nvm.

Add a PATH-extension fallback in both pre-commit and run-node-tool.sh
that walks ~/.nvm/versions/node/*/bin/node and prepends the first
found binary to PATH, mirroring how nvm itself resolves the runtime.
2026-03-13 08:59:53 +00:00
Peter Steinberger
50f233d16d chore: stabilize prek hooks runner selection (#1720) (thanks @dguido) 2026-01-25 10:55:28 +00:00