From 3c1cb935d2b69f6dcbc385d57023840a5760bb12 Mon Sep 17 00:00:00 2001 From: Cotes Chung <11371340+cotes2020@users.noreply.github.com> Date: Sat, 12 Oct 2019 01:07:38 +0800 Subject: [PATCH] Improved the init tool. Remove the Python cache files. --- init.sh | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/init.sh b/init.sh index e95821a..b801e2a 100755 --- a/init.sh +++ b/init.sh @@ -1,6 +1,6 @@ #!/bin/bash # -# Initial the categories/tags pages and for posts. +# Initial the Categories/Tags pages and Lastmod for posts. # © 2019 Cotes Chung # Published under MIT License @@ -19,11 +19,13 @@ fi python _scripts/py/init_all.py +find . | grep -E "(__pycache__|\.pyc|\.pyo$)" | xargs rm -rf + msg="Updated" if [[ ! -z $(git status categories -s) ]]; then git add categories/ - msg+=" Categories' pages" + msg+=" the Categories" CATEGORIES=true fi @@ -31,16 +33,20 @@ fi if [[ ! -z $(git status tags -s) ]]; then git add tags/ if [[ $CATEGORIES = true ]]; then - msg+=" and" + msg+="," + else + msg+=" the" fi - msg+=" Tags' pages" + msg+=" Tags" TAGS=true fi if [[ ! -z $(git status _posts -s) ]]; then git add _posts/ if [[ $CATEGORIES = true || $TAGS = true ]]; then - msg+=" and" + msg+="," + else + msg+=" the" fi msg+=" Lastmod" LASTMOD=true