diff options
| author | Joe Carstairs <me@joeac.net> | 2026-06-18 09:22:49 +0100 |
|---|---|---|
| committer | Joe Carstairs <me@joeac.net> | 2026-06-18 09:22:49 +0100 |
| commit | f219908d67c7ce726641e5b425a29923674d45b5 (patch) | |
| tree | eb8eaae089d74d765d522f49350b69bbe2d73197 | |
| parent | 5e371cf734bdd2cc946da23ee1cf45a54ac3afcb (diff) | |
prune_blog takes optional BLOG_POST_PATTERN argument
| -rwxr-xr-x | http/bin/prune_blog | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/http/bin/prune_blog b/http/bin/prune_blog index 4193e4b..51be54a 100755 --- a/http/bin/prune_blog +++ b/http/bin/prune_blog @@ -1,6 +1,7 @@ #!/bin/sh -e BLOG="$1" +BLOG_POST_PATTERN="${2:-*}" SRC="$(realpath src)" BLOGS="$(realpath blogs)" @@ -8,7 +9,7 @@ LAYOUTS="$(realpath share/layouts)" BLOG_DIR_IN_SRC="${SRC}/${BLOG}" 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 last_segment="${post##*\.}" if [ "$last_segment" = "args" ] |
