-
Notifications
You must be signed in to change notification settings - Fork 227
Wrap commands in Git bash on Windows #953
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
lefthook should pass Windows env to git bash though |
Hey! I like your suggestion. I will try to play with it on Windows, but I think lefthook should first check if there's |
and print error msg if it's not installed |
Not printing an error yet, but implemented wrapping with |
Have you passed params when running git hooks? post-checkout:
commands:
check-pnpm-lock:
run: |
if [ "$3" -eq 1 ]; then
if git diff --quiet "$1" "$2" -- pnpm-lock.yaml; then
echo pnpm-lock.yaml changed! Run pnpm install ...
pnpm install
fi
fi it throws |
BTW, are you using single or double quotes to wrap commands? |
Using double quotes, so the actual command becomes |
Could you run this with |
{1}, {2} works, thank you! |
Another issue is that the |
just found |
⚡ Summary
According to docs,
run
commands behave differently on Linux and Windows. This is not ideal.We can wrap commands in git bash, which is located in
C:\Program Files\Git\bin\sh.exe
.Value
Provide command consistency.
Behavior and configuration changes
commands should behave the same on Linux and Windows.
The text was updated successfully, but these errors were encountered: