iTwin / eslint-plugin

MIT License
0 stars 0 forks source link

Fix git pre-commit action failure #62

Closed anmolshres98 closed 7 months ago

anmolshres98 commented 7 months ago

The the reason for this failure was in https://github.com/iTwin/eslint-plugin/pull/51, husky was upgraded to v9. The way husky executes shell scripts is different in v9. It always uses sh instead of bash: https://github.com/typicode/husky/releases/tag/v9.0.1

image

[[ operator is a bash feature and is not available on regular shell: https://stackoverflow.com/questions/3401183/bash-syntax-error-not-found Hence, previously this was not failing because bash was being used but now it is failing because sh is being used after the husky upgrade. So, the shell script needs to use grep instead of [[]] now for it to work properly.

Working example: https://github.com/iTwin/eslint-plugin/actions/runs/7937037057/job/21673467158