Improve generated filenames in mkdraft
This commit is contained in:
parent
89bf04871f
commit
e8e113b24d
1 changed files with 1 additions and 1 deletions
|
|
@ -16,7 +16,7 @@ function yes_or_no {
|
||||||
}
|
}
|
||||||
|
|
||||||
title="$@"
|
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
|
if [ -f $path ]; then
|
||||||
yes_or_no "$path already exists! Do you want to overwrite it?" || exit
|
yes_or_no "$path already exists! Do you want to overwrite it?" || exit
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue