Fixed erroneous reference to former static ~/.sns BASEDIR

Added hook to actually delete a note if requested
Removed old, commented code
Simplified create and delete logic by removing unnecessary checks that make no sense to me now
Cleaned up output from create event
This commit is contained in:
Jon-William Lewis
2015-09-19 18:40:43 -05:00
committed by Jon-William Lewis
parent 337a1bf3a3
commit 35094aed04
5 changed files with 28 additions and 78 deletions

View File

@@ -1,17 +1,13 @@
function delete(){
if [ "$DELETE" == "TRUE" ]; then
if [ -e "$NOTE" ] || [ -e "${NOTE%.*}" ]; then
if [ "$ENCRYPTION" == "TRUE" ]; then
rm "${NOTE%.*}"
else
rm "$NOTE"
fi
if [ -e "$NOTE" ]; then
rm "$NOTE"
echo ""
echo "Deleted note: $NOTEBOOK/$SECTION$NAME."
echo "Deleted note: $NOTEBOOK/$SECTION/$NAME."
exit
else
echo ""
echo "ERROR: Note $NOTEBOOK/$SECTION$NAME does not exist."
echo "ERROR: Note $NOTEBOOK/$SECTION/$NAME does not exist."
exit
fi
fi