From 2e03339e7b72dc244ef6b944b79bf092b23289ab Mon Sep 17 00:00:00 2001 From: Daniel Liu Date: Wed, 25 Nov 2020 23:45:28 -0500 Subject: [PATCH] addde back refresh --- pb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pb b/pb index 7905b54..6b9a6b4 100755 --- a/pb +++ b/pb @@ -25,6 +25,13 @@ init() { echo "Successfully created blog files." } +refresh() { + read -p "Are you sure you want to refresh? [y/n] " ask + [ "$ask" != "y" ] && echo "Aborting..." && exit 0 + + echo -e "$blog_index_file\n$rolling_file\n$rss_file" | xargs sed -i "//,//{//!{//!d}}" + echo "Successfully refreshed." +} backup() { backup_name=`mktemp --tmpdir="$data_dir/backups" -d "backup_$(date +'%b-%d')_XXX"` @@ -108,5 +115,6 @@ case $1 in p|publish) publish;; d|delete) delete;; b|backup) backup;; + r|refresh) refresh;; h|*) echo -e "=-=-=-=-=-=-= Pb =-=-=-=-=-=-=\nAvailable commands:\nn - new blog post\np - publish existing blog post\nd - deletes published post\nb - creates a backup";; esac -- 2.20.1