We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When running the hooks locally in a zsh mapfile is not available this breaks all hooks loading the new _common.sh
- repo: https://github.com/antonbabenko/pre-commit-terraform rev: v1.87.0 hooks: - id: terraform_fmt
run in zsh
uname -a
systeminfo | Select-String "^OS"
Darwin MAC 23.3.0 Darwin Kernel Version 23.3.0: Wed Dec 20 21:30:44 PST 2023; root:xnu-10002.81.5~7/RELEASE_ARM64_T6000 arm64
GNU bash, version 3.2.57(1)-release (arm64-apple-darwin23) pre-commit 3.6.0 Terraform v1.7.1 Python 3.11.7 Python 3.11.7 checkov 3.2.0 infracost SKIPPED terraform-docs SKIPPED terragrunt version 0.55.1 terrascan SKIPPED TFLint version 0.50.3 + ruleset.terraform (0.5.0-bundled) tfsec SKIPPED trivy Version: 0.49.1 Vulnerability DB: Version: 2 UpdatedAt: 2022-06-24 06:06:57.585311457 +0000 UTC NextUpdate: 2022-06-24 12:06:57.585311157 +0000 UTC DownloadedAt: 2022-06-24 08:02:01.406102 +0000 UTC tfupdate SKIPPED hcledit SKIPPED flock SKIPPED
.pre-commit-config.yaml
The text was updated successfully, but these errors were encountered:
mapfile was introduced in bash 4.0.
mapfile
MacOS uses zsh by default, and only installs v3.x of bash by default.
We can replace mapfile with something like this:
dir_paths_unique=() while IFS= read -r line ; do dir_paths_unique+=("$line) done < <(echo "${dir_paths[@]}" | tr ' ' '\n' | sort -u)
Sorry, something went wrong.
Thanks for catching this. Supporting older and newer Bash is cumbersome =( Please check whether #627 fixes the issue.
Thx for the quick fix. The new update resolved the issue
Fixed in v1.87.1
No branches or pull requests
Describe the bug
When running the hooks locally in a zsh mapfile is not available this breaks all hooks loading the new _common.sh
How can we reproduce it?
run in zsh
Environment information
uname -a
and/orsysteminfo | Select-String "^OS"
output:Darwin MAC 23.3.0 Darwin Kernel Version 23.3.0: Wed Dec 20 21:30:44 PST 2023; root:xnu-10002.81.5~7/RELEASE_ARM64_T6000 arm64
.pre-commit-config.yaml
:file content
The text was updated successfully, but these errors were encountered: