From 18e595bb499faf2589c1f8594234d79e159868c6 Mon Sep 17 00:00:00 2001 From: uniporn Date: Mon, 21 May 2018 13:36:00 +0200 Subject: add option to trash post --- bb.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/bb.sh b/bb.sh index 69875d4..a7e0aa3 100755 --- a/bb.sh +++ b/bb.sh @@ -623,6 +623,17 @@ EOF echo "Saved your draft as '$draft'" exit fi + + if [[ $post_status == t || $post_status == T ]]; then + echo "Are you sure to trash the post? It will not be saved anywhere." + echo "If and only if you are sure to trash this post, type \"YES\"" + read -r really_trash + if [[ $really_trash == 'YES' ]]; then + delete_includes + rm "$filename" + rm "$TMPFILE" + fi + fi done if [[ $fmt == md && -n $save_markdown ]]; then -- cgit v1.2.3