1
0
Fork 0

Blog script edit

Fixed blog script trying to move deleted files to non-existing trash
directory
master
Stefan 1 year ago
parent 3d6bee9aa0
commit 7164b5f7ca

@ -21,6 +21,8 @@ publish() {
remove() {
POST_PATH="$BLOG_PATH/content/posts/${1}.md"
[ ! -f "$POST_PATH" ] && echo "Post does not exist. Nothing to remove." && exit 1
[ ! -d "$BLOG_PATH/.trash" ] mkdir -p "$BLOG_PATH/.trash"
mv "$POST_PATH" "$BLOG_PATH/.trash/"
echo "Post successfully deleted. If you need to restore it, you can find it in $BLOG_PATH/.trash/${1}.md"
}

Loading…
Cancel
Save