From 0e00d6394c49c6a69a9ac4418ba77719d5f44e02 Mon Sep 17 00:00:00 2001 From: Hugo Levy-Falk Date: Thu, 25 Jul 2024 10:08:18 +0200 Subject: [PATCH] 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). --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5015113..c6ee030 100644 --- a/README.md +++ b/README.md @@ -213,7 +213,10 @@ exec 1>&2 # Run Runic on added and modified files mapfile -t files < <(git diff-index --name-only --diff-filter=AM master | grep '\.jl$') -julia --project=@runic -m Runic --check --diff "${files[@]}" + +if [ ! -z "${files}" ]; then + julia --project=@runic -m Runic --check --diff "${files[@]}" +fi ``` ## Formatting specification