pre-commit hook: fix shellcheck SC2207
Prefer mapfile or read -a to split command output https://github.com/koalaman/shellcheck/wiki/SC2207
This commit is contained in:
parent
a1c87c43ca
commit
7ecfcf5814
|
@ -10,8 +10,8 @@ fi
|
||||||
|
|
||||||
diff="git diff-index --name-only --cached $against --diff-filter d"
|
diff="git diff-index --name-only --cached $against --diff-filter d"
|
||||||
|
|
||||||
nix_files=($($diff -- '*.nix'))
|
mapfile -t nix_files < <($diff -- '*.nix')
|
||||||
all_files=($($diff))
|
mapfile -t all_files < <($diff)
|
||||||
|
|
||||||
# Format staged nix files.
|
# Format staged nix files.
|
||||||
if [[ -n "${nix_files[@]}" ]]; then
|
if [[ -n "${nix_files[@]}" ]]; then
|
||||||
|
|
Loading…
Reference in a new issue