Skip to content

Commit 687fc2f

Browse files
committed
Improved the init tool.
Remove the Python cache files.
1 parent 69d9d06 commit 687fc2f

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

init.sh

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22
#
3-
# Initial the categories/tags pages and for posts.
3+
# Initial the Categories/Tags pages and Lastmod for posts.
44
# © 2019 Cotes Chung
55
# Published under MIT License
66

@@ -19,28 +19,34 @@ fi
1919

2020
python _scripts/py/init_all.py
2121

22+
find . | grep -E "(__pycache__|\.pyc|\.pyo$)" | xargs rm -rf
23+
2224
msg="Updated"
2325

2426
if [[ ! -z $(git status categories -s) ]]; then
2527
git add categories/
26-
msg+=" Categories' pages"
28+
msg+=" the Categories"
2729
CATEGORIES=true
2830
fi
2931

3032

3133
if [[ ! -z $(git status tags -s) ]]; then
3234
git add tags/
3335
if [[ $CATEGORIES = true ]]; then
34-
msg+=" and"
36+
msg+=","
37+
else
38+
msg+=" the"
3539
fi
36-
msg+=" Tags' pages"
40+
msg+=" Tags"
3741
TAGS=true
3842
fi
3943

4044
if [[ ! -z $(git status _posts -s) ]]; then
4145
git add _posts/
4246
if [[ $CATEGORIES = true || $TAGS = true ]]; then
43-
msg+=" and"
47+
msg+=","
48+
else
49+
msg+=" the"
4450
fi
4551
msg+=" Lastmod"
4652
LASTMOD=true

0 commit comments

Comments
 (0)