mirror of
https://github.com/divnix/digga.git
synced 2024-12-23 08:02:21 +03:00
devos: Fix editorconfig Git hook when no files are changed
It is possible to make a commit with no files, e.g. with `--allow-empty` or `--only` flags to `git-commit`. Previously, this hook would hang indefinitely in those cases as `editorconfig-checker` with no file arguments will read from stdin.
This commit is contained in:
parent
34cb98601d
commit
dd51f64bc5
@ -20,7 +20,10 @@ if (( ${#nix_files[@]} != 0 )); then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# check editorconfig
|
# check editorconfig
|
||||||
editorconfig-checker -- "${all_files[@]}"
|
if (( ${#all_files[@]} != 0 )); then
|
||||||
|
editorconfig-checker -- "${all_files[@]}"
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ $? != '0' ]]; then
|
if [[ $? != '0' ]]; then
|
||||||
printf "%b\n" \
|
printf "%b\n" \
|
||||||
"\nCode is not aligned with .editorconfig" \
|
"\nCode is not aligned with .editorconfig" \
|
||||||
|
Loading…
Reference in New Issue
Block a user