главная|main page

состояние|status

блог|blog

файлы|files

программы|software

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoruniporn <dotfiles@uniporn.org>2018-05-21 13:36:00 +0200
committeruniporn <dotfiles@uniporn.org>2018-05-21 13:36:00 +0200
commit18e595bb499faf2589c1f8594234d79e159868c6 (patch)
tree6a014f2bf72a6fb8211ddbfa8c8a307eac72838f
parent89780c3108bddac6582498ce86e4d344465a4e3a (diff)
add option to trash post
-rwxr-xr-xbb.sh11
1 files changed, 11 insertions, 0 deletions
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