You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
husky hooks failing to execute as latest RC depends on /bin/bash #3860
@markgoho-EDT we've had a couple of run-ins with Husky and pre-commits in the past (see #2518 and #1734) but that error message is new. Are you able to put together a more detailed repro of the issue, so we can ensure we're testing the right behaviour?
@shiftkey There's not much more to what I did besides install Husky, add the pre-push/pre-commit hooks and then try to commit and push via the Desktop client.
I'm not sure why you're on the RC version of Husky here, but it looks like they've decided to force everyone to use #!/bin/bash to execute bash scripts. The version of Git we use in Desktop doesn't support Bash scripting (it's stripped back to the minimum that apps need, and bash.exe didn't make the cut). The previous stable version of Husky uses #!/bin/sh which doesn't trigger the error in Desktop.
I'm not sure why Husky is forcing /bin/bash here, and I've not had a chance to test other shells like CMD and PowerShell to see if they're affected by this change.
The husky maintainer has switched back to the stable release of husky for now which doesn't depend on /bin/bash, and I'm working with them to see if they can keep the next version running without requiring bash on Windows, so I'm going to close this out and track the upstream issue.
Reacted by Mark Goho, mklarmann, MILLER/F and Herve Fulchiron
Activity
iAmWillShepherd commentedon Jan 26, 2018
You should be able to find your logs by clicking
Help -> Show logs in explorer.shiftkey commentedon Jan 28, 2018
@markgoho-EDT we've had a couple of run-ins with Husky and pre-commits in the past (see #2518 and #1734) but that error message is new. Are you able to put together a more detailed repro of the issue, so we can ensure we're testing the right behaviour?
markgoho-EDT commentedon Jan 31, 2018
@iAmWillShepherd logs:
@shiftkey There's not much more to what I did besides install Husky, add the pre-push/pre-commit hooks and then try to commit and push via the Desktop client.
Here are my pre-commit and pre-push files:
pre-push:
pre-commit:
shiftkey commentedon Feb 1, 2018
@markgoho-EDT
I think the version of Husky here would have helped, which is thankfully embedded in the hook scripts.
Here's a working
package.jsonfile for Husky:And here's one that doesn't:
I'm not sure why you're on the RC version of Husky here, but it looks like they've decided to force everyone to use
#!/bin/bashto execute bash scripts. The version of Git we use in Desktop doesn't support Bash scripting (it's stripped back to the minimum that apps need, andbash.exedidn't make the cut). The previous stable version of Husky uses#!/bin/shwhich doesn't trigger the error in Desktop.I'm not sure why Husky is forcing
/bin/bashhere, and I've not had a chance to test other shells like CMD and PowerShell to see if they're affected by this change.[-]Husky hooks failing[/-][+]husky hooks failing to execute as latest RC depends on /bin/bash [/+]j-f1 commentedon Feb 1, 2018
The blame shows that the
#!was changed in October, in typicode/husky@48e3f88, which tells us that this change was to “Update hook.sh.”shiftkey commentedon Feb 1, 2018
I've cross-referenced this information in a related issue against the repository: typicode/husky#228
shiftkey commentedon Feb 2, 2018
The
huskymaintainer has switched back to the stable release ofhuskyfor now which doesn't depend on/bin/bash, and I'm working with them to see if they can keep the next version running without requiringbashon Windows, so I'm going to close this out and track the upstream issue.millerf commentedon May 3, 2018
+1