From: Christian Heller Date: Mon, 2 Jan 2017 22:36:37 +0000 (+0100) Subject: Handle empty blog case in README recipe. X-Git-Url: https://plomlompom.com/repos/%7B%7Bdb.prefix%7D%7D/%7B%7B%20web_path%20%7D%7D/static/todo?a=commitdiff_plain;h=b30ef996fa5865124811032655f80eba65ee8d0d;p=redo-blog Handle empty blog case in README recipe. --- 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