Made changes to create and delete functions reflecting recent design decisions

This commit is contained in:
Jon-William Lewis
2016-02-15 01:18:44 -06:00
parent faab86dff2
commit 037fd9c2fa
3 changed files with 27 additions and 31 deletions

View File

@@ -1,10 +1,11 @@
function delete(){
#Requires: $NOTE, $NOTEBOOK, $SECTION, $NAME
# Requires: $NOTE, $NOTE_DIR
# Given a valid $NOTE, delete removes $NOTE from sns.
if [ -e "$NOTE" ]; then
rm "$NOTE"
printf "\n%s\n" "Deleted note: $NOTEBOOK/$SECTION/$NAME."
if [ -e "$NOTE_DIR/$NOTE" ]; then
rm "$NOTE_DIR/$NOTE"
printf " - %s\n" "Deleted note: ${NOTE%.*}."
else
printf "\n%s\n" "ERROR: Note $NOTEBOOK/$SECTION/$NAME does not exist."
printf " $RED_COLOR!$RESET_COLOR %s\n" "Note ${NOTE%.*} does not exist."
fi
}