From b30ef996fa5865124811032655f80eba65ee8d0d Mon Sep 17 00:00:00 2001 From: Christian Heller Date: Mon, 2 Jan 2017 23:36:37 +0100 Subject: [PATCH] Handle empty blog case in README recipe. --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 49ad8b1..d9e0f2c 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,11 @@ called `blog`: git checkout -f cd "\$GIT_WORK_TREE" redo - git add metadata/author metadata/url metadata/title metadata/*.tmpl metadata/*.automatic_metadata metadata/automatic_metadata + git add metadata/author metadata/url metadata/title metadata/*.tmpl metadata/automatic_metadata + count=\$(ls -1 metadata/*.automatic_metadata 2>/dev/null | wc -l) + if [ "\$count" != 0 ]; then + git add metadata/*.automatic_metadata + fi status=\$(git status -s) n_updates=\$(printf "$status" | grep -vE '^\?\?' | wc -l) if [ "\$n_updates" -gt 0 ]; then -- 2.30.2