prune_blog takes optional BLOG_POST_PATTERN argument
This commit is contained in:
+2
-1
@@ -1,6 +1,7 @@
|
|||||||
#!/bin/sh -e
|
#!/bin/sh -e
|
||||||
|
|
||||||
BLOG="$1"
|
BLOG="$1"
|
||||||
|
BLOG_POST_PATTERN="${2:-*}"
|
||||||
|
|
||||||
SRC="$(realpath src)"
|
SRC="$(realpath src)"
|
||||||
BLOGS="$(realpath blogs)"
|
BLOGS="$(realpath blogs)"
|
||||||
@@ -8,7 +9,7 @@ LAYOUTS="$(realpath share/layouts)"
|
|||||||
BLOG_DIR_IN_SRC="${SRC}/${BLOG}"
|
BLOG_DIR_IN_SRC="${SRC}/${BLOG}"
|
||||||
BLOG_EXT=gmi
|
BLOG_EXT=gmi
|
||||||
|
|
||||||
for post in $(find "$BLOG_DIR_IN_SRC" -type f)
|
for post in $(find "$BLOG_DIR_IN_SRC" -type f -and -name "$BLOG_POST_PATTERN")
|
||||||
do
|
do
|
||||||
last_segment="${post##*\.}"
|
last_segment="${post##*\.}"
|
||||||
if [ "$last_segment" = "args" ]
|
if [ "$last_segment" = "args" ]
|
||||||
|
|||||||
Reference in New Issue
Block a user