mirror of
https://github.com/divnix/digga.git
synced 2024-12-22 23:51:39 +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
|
||||
|
||||
# check editorconfig
|
||||
editorconfig-checker -- "${all_files[@]}"
|
||||
if (( ${#all_files[@]} != 0 )); then
|
||||
editorconfig-checker -- "${all_files[@]}"
|
||||
fi
|
||||
|
||||
if [[ $? != '0' ]]; then
|
||||
printf "%b\n" \
|
||||
"\nCode is not aligned with .editorconfig" \
|
||||
|
Loading…
Reference in New Issue
Block a user