forked from github/pre-commit-opentofu
feat: Removed coreutils (realpath) from dependencies for MacOS (#368)
This commit is contained in:
parent
4874cfe42e
commit
944a2e5fef
14 changed files with 15 additions and 17 deletions
|
|
@ -69,7 +69,7 @@ function common::is_hook_run_on_whole_repo {
|
|||
shift 1
|
||||
local -a -r files=("$@")
|
||||
# get directory containing `.pre-commit-hooks.yaml` file
|
||||
local -r root_config_dir="$(dirname "$(dirname "$(realpath "${BASH_SOURCE[0]}")")")"
|
||||
local -r root_config_dir="$(dirname "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)")"
|
||||
# get included and excluded files from .pre-commit-hooks.yaml file
|
||||
local -r hook_config_block=$(sed -n "/^- id: $hook_id$/,/^$/p" "$root_config_dir/.pre-commit-hooks.yaml")
|
||||
local -r included_files=$(awk '$1 == "files:" {print $2; exit}' <<< "$hook_config_block")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue