Browse Source

fix(readme): Add a test for empty file list in git hook.

As it was, the proposed git hook will fail if no Julia file has been
edited in the commit (for example if we only edited Project.toml).
pull/26/head
Hugo Levy-Falk 1 year ago
parent
commit
0e00d6394c
  1. 3
      README.md

3
README.md

@ -213,7 +213,10 @@ exec 1>&2
# Run Runic on added and modified files # Run Runic on added and modified files
mapfile -t files < <(git diff-index --name-only --diff-filter=AM master | grep '\.jl$') mapfile -t files < <(git diff-index --name-only --diff-filter=AM master | grep '\.jl$')
if [ ! -z "${files}" ]; then
julia --project=@runic -m Runic --check --diff "${files[@]}" julia --project=@runic -m Runic --check --diff "${files[@]}"
fi
``` ```
## Formatting specification ## Formatting specification

Loading…
Cancel
Save