Added confirmation prompt to delete function

This commit is contained in:
Jon-William Lewis
2016-08-27 13:13:56 -05:00
parent 80c0fc556a
commit 0f2684bde5

View File

@@ -54,7 +54,13 @@ function delete(){
# Given a valid $NOTE, delete removes $NOTE from sns.
if [ -e "$NOTES_DIR/$NOTE" ]; then
rm "$NOTES_DIR/$NOTE"
read -p "Delete \"$NOTE\"? (Y/N) " YN
case "$YN" in
Y|y)
rm "$NOTES_DIR/$NOTE";;
*)
printf "%s\n " "Aborted.";;
esac
printf "%s\n" "- Deleted note: ${NOTE%.*}."
#Cleanup empty notebooks/sections]
find "$NOTES_DIR" -mindepth 1 -type d | tac |\