File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ read_tags() {
4545
4646
4747init () {
48+
4849 if [[ -d categories ]]; then
4950 rm -rf categories
5051 fi
@@ -53,6 +54,10 @@ init() {
5354 rm -rf tags
5455 fi
5556
57+ if [[ ! -d _posts ]]; then
58+ exit 0
59+ fi
60+
5661 mkdir categories tags
5762}
5863
@@ -130,6 +135,7 @@ create_pages() {
130135
131136
132137main () {
138+
133139 init
134140
135141 for _file in $( ls " _posts" )
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ OUTPUT_FILE=updates.yml
1919
2020
2121_init () {
22+
2223 if [[ ! -d " $OUTPUT_DIR " ]]; then
2324 mkdir " $OUTPUT_DIR "
2425 fi
@@ -27,7 +28,9 @@ _init() {
2728 rm -f " $OUTPUT_DIR /$OUTPUT_FILE "
2829 fi
2930
30- touch " $OUTPUT_DIR /$OUTPUT_FILE "
31+ if [[ ! -d $POST_DIR ]]; then
32+ exit 0
33+ fi
3134}
3235
3336
@@ -55,6 +58,10 @@ _has_changed() {
5558_dump () {
5659 local _lasmod=" ` git log -1 --pretty=%ad --date=iso $2 ` "
5760
61+ if [[ ! -f " $OUTPUT_DIR /$OUTPUT_FILE " ]]; then
62+ touch " $OUTPUT_DIR /$OUTPUT_FILE "
63+ fi
64+
5865 echo " -" >> " $OUTPUT_DIR /$OUTPUT_FILE "
5966 echo " filename: '$1 '" >> " $OUTPUT_DIR /$OUTPUT_FILE "
6067 echo " lastmod: '$_lasmod '" >> " $OUTPUT_DIR /$OUTPUT_FILE "
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ check_status() {
1919 local _change=$( git status . -s)
2020
2121 if [[ ! -z ${_change} ]]; then
22- echo " Warning: Commit the changes of the changes first:"
22+ echo " Warning: Commit the following changes first:"
2323 echo " $_change "
2424 exit 1
2525 fi
You can’t perform that action at this time.
0 commit comments