]> danix's work - bash-notes.git/commitdiff
Added sleep 1 sec after deleting notes to allow the user to read the
authordanix <redacted>
Mon, 10 Apr 2023 08:21:09 +0000 (10:21 +0200)
committerdanix <redacted>
Mon, 10 Apr 2023 08:21:09 +0000 (10:21 +0200)
message before the window closes.
modified:   SOURCE/CORE/core-remove.sh
modified:   notes.sh

SOURCE/CORE/core-remove.sh
notes.sh

index 5776bbc6fe9f63319d8302ff070f2a00e3a991ff..0111d0fe7f264326d641e6a6c229e60017e2af5a 100644 (file)
@@ -29,6 +29,7 @@ function rmnote() {
                if [ ! "$OK" ]; then
                        echo "invalid note \"$NOTE\""
                        echo "Use the note ID that you can fetch after listing your notes"
+                       sleep 1
                        exit 1
                fi
 
@@ -43,8 +44,11 @@ function rmnote() {
                        mv $TMPDB $DB
                        rm $NOTESDIR/$FILE
                        echo "Deleted note $TITLE"
+                       sleep 1
+                       exit
                else
                         echo "note not found"
+                        sleep 1
                         exit 1
                fi
        fi
index 8a9c082237a31b84c5ec43f454811224d0610da1..d0fd902f3a9e0fc97c5d44f8dfc38ccc8f17f2bb 100755 (executable)
--- a/notes.sh
+++ b/notes.sh
@@ -379,6 +379,7 @@ function rmnote() {
                if [ ! "$OK" ]; then
                        echo "invalid note \"$NOTE\""
                        echo "Use the note ID that you can fetch after listing your notes"
+                       sleep 1
                        exit 1
                fi
 
@@ -393,8 +394,11 @@ function rmnote() {
                        mv $TMPDB $DB
                        rm $NOTESDIR/$FILE
                        echo "Deleted note $TITLE"
+                       sleep 1
+                       exit
                else
                         echo "note not found"
+                        sleep 1
                         exit 1
                fi
        fi