Improved the tool scripts.

- Avoid the empty lastmod file.
- Check if there is no post.
- Fixed the prompt message.
This commit is contained in:
Cotes Chung
2020-07-13 11:20:07 +08:00
parent c0ba181246
commit 0d47beba97
3 changed files with 15 additions and 2 deletions

View File

@@ -45,6 +45,7 @@ read_tags() {
init() {
if [[ -d categories ]]; then
rm -rf categories
fi
@@ -53,6 +54,10 @@ init() {
rm -rf tags
fi
if [[ ! -d _posts ]]; then
exit 0
fi
mkdir categories tags
}
@@ -130,6 +135,7 @@ create_pages() {
main() {
init
for _file in $(ls "_posts")