gabyx / Githooks

🦎 Githooks: per-repo and shared Git hooks with version control and auto update. [✩Star] if you're using it!
MIT License
102 stars 4 forks source link

Installer problems on mac os arm64 #126

Closed gimiki closed 8 months ago

gimiki commented 10 months ago

Just to report some problems that may prevent an easy installation of Githooks on a mac os with ARM.

Description

Installer Dependencies

On a mac os (13.5.1 with arm64), during the installation with the provided script I get the following error:

> curl -sL https://raw.githubusercontent.com/gabyx/githooks/main/scripts/install.sh | bash -s -- -- \
    --dry-run
bash: line 12: local: -n: invalid option
local: usage: local name[=value] ...

This is because the default bash version on a mac OS seems to be 3.2.57. With this version, local doesn't accept any option and declare doesn't accept -n option, that are present in bash 5.

I cannot found this requirement in the documentation.

die not found

If I install latest bash with homebrew (i.e. bash 5.2) on the same machine, die is not present:

❯ curl -sL https://raw.githubusercontent.com/gabyx/githooks/main/scripts/install.sh | bash -s -- -- \
    --dry-run
main: line 105: die: command not found

I think this is because a wrong uname -p command for arm64 architecture that returns arm insted of expected arm64, I will create a PR.

gabyx commented 8 months ago

Thanks!