lb

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 07ac6fc539a34b9c3bc326e5785aa0116f318919
parent 52fc28c6261036d9992ce16c07b85906332e6976
Author: Luke Smith <luke@lukesmith.xyz>
Date:   Sun, 29 Jul 2018 21:56:18 -0400

`discard` command for drafts

Diffstat:
Mlb | 9+++++++++
1 file changed, 9 insertions(+), 0 deletions(-)

diff --git a/lb b/lb @@ -63,8 +63,17 @@ delete() { \ sed -i "/<div/{:a;N;/<\/div>/!ba};/$base/d" $blogfile && echo "HTML code removed from blogfile." } +discard() { \ + listandReturn "$dir/blog/.drafts/*.html" discard + base=$(echo $chosen | cut -f1 -d'.') + read -p "Really discard \"$base\"? (y,N) " choice + [[ $choice =~ [Yy] ]] || exit + rm $dir/blog/.drafts/$chosen && echo "Blog draft discarded." + } + case "$1" in new) getTitle && postNew ;; + discard) discard ;; finalize) finalize ;; delete) delete ;; *) getHelp ;;