From e8e113b24d68f834ffa5bf7c827ee581259b6b2b Mon Sep 17 00:00:00 2001 From: arne Date: Mon, 22 Jul 2024 21:32:02 +0200 Subject: [PATCH] Improve generated filenames in `mkdraft` --- scripts/mkdraft.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/mkdraft.sh b/scripts/mkdraft.sh index 1ed0952..2cf5c15 100755 --- a/scripts/mkdraft.sh +++ b/scripts/mkdraft.sh @@ -16,7 +16,7 @@ function yes_or_no { } title="$@" -path="src/posts/drafts/$(date +%F)-$(echo -n $title | tr 'A-Z' 'a-z' | tr -c '[:alnum:]' -).md" +path="src/posts/drafts/$(date +%F)-$(echo -n $title | tr 'A-Z' 'a-z' | tr -c '[:alnum:]' - | sed -E 's|-+|-|g').md" if [ -f $path ]; then yes_or_no "$path already exists! Do you want to overwrite it?" || exit