Closed mjk-gh closed 3 years ago
Hi @mjk-gh
It doesn't seem to be a POSIX sh vs. Bash issue, but I agree the error message could be improved there. Check the relevant code at https://github.com/rycus86/githooks/blob/master/cli.sh#L2209 which assumes that git hooks config
has at least one more argument behind it. I assume Bash might silently ignore the shift
failure there.
You can check the available arguments there with git hooks config help
I can put in a change to check if the CONFIG_ARGUMENT
variable is empty, or the number of arguments is less than 2 and print a more useful error message there instead of can't shift that many
The currently used shebang is:
On systems that only have
bash
installed,/bin/sh
is the same as/bin/bash
.However, on systems that have a POSIX shell installed (e.g.
dash
),/bin/sh
is notbash
, butdash
instead, so the githooks script does not work properly anymore:Replacing the shebang with
fixes above error.