From dea704c57dea8ba9c9538ddea6638fbd4e5c7660 Mon Sep 17 00:00:00 2001 From: Sergey Galuza Date: Mon, 20 Apr 2026 16:58:13 +0200 Subject: [PATCH] fix(husky): re-exec pre-push under bash for sh compatibility Husky v9 invokes hooks via `sh -e` regardless of the script's shebang, causing `set -o pipefail` and bash regex `[[ =~ ]]` in .husky/pre-push to fail with "Illegal option -o pipefail" on systems where /bin/sh is not bash (Debian/Ubuntu dash). Add a POSIX-compatible preamble that re-execs the script under bash when invoked without BASH_VERSION. No changes to gate logic. Built [OnSteroids](https://onsteroids.ai) --- .husky/pre-push | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.husky/pre-push b/.husky/pre-push index 4dee9050..07a426a0 100755 --- a/.husky/pre-push +++ b/.husky/pre-push @@ -1,4 +1,10 @@ #!/usr/bin/env bash +# Husky v9 invokes hooks via `sh -e` (see .husky/_/h), ignoring this shebang. +# Re-exec under bash so `set -o pipefail` and `[[ ... ]]` below work portably. +if [ -z "${BASH_VERSION:-}" ]; then + exec bash "$0" "$@" +fi + set -euo pipefail # Protected branches keep the full CI parity gate.