Open
Description
Describe the bug
When using a pre-commit hook such as lefthook
, it is impossible to commit due to a popup error indicating that node
was not found.
To Reproduce
- Create a new folder and open the terminal.
- Run Terminal commands:
echo "node_modules\n.DS_Store" > .gitignore
git init
git add -A
git commit -m "Initialize repo"
npm install --save-dev lefthook
- Replace the contents of
lefthook.yml
with the following content:
pre-commit:
commands:
check:
glob: "*.{txt}"
run: node -v
- Run Terminal commands:
git add -A && git commit -m "Add lefthook"
echo Test > README.md
- Open the above created repository in Gitnuro.
- Stage
README.md
and add a commit message. - Click "Commit".
An error saying that node
cannot be found will be shown, even if Node is installed and available on the terminal path. (It even works if I pop open a terminal from Gitnuro and run node -v
or git commit
.)
Expected behavior
The commit hook should run exactly as it does if using git commit
from the CLI, and no error should be shown.
Screenshots
Desktop (please complete the following information):
OS: macOS 15.1
Gitnuro version: 1.3.1