diff --git a/src/includes/create.sns.sh b/src/includes/create.sns.sh index 2a9d6a6..2303d23 100644 --- a/src/includes/create.sns.sh +++ b/src/includes/create.sns.sh @@ -6,7 +6,7 @@ function create(){ # by p_header, to $NOTE. # Refuse to overwrite a note - if [ -e "$NOTE_DIR/$NOTE" ]; then + if [ -e "$NOTES_DIR/$NOTE" ]; then >&2 printf " $RED_COLOR!$RESET_COLOR %s\n\t%s\n"\ "Note already exists"\ "Hint: use -e to edit the note." @@ -15,7 +15,7 @@ function create(){ # If the note's notebook/section does not exist, # create the appropriate folders. - mkdir -p "$NOTE_DIR"/$(dirname "$NOTE") + mkdir -p "$NOTES_DIR"/"$(dirname "$NOTE")" # Write the standard note header if [ "$ENCRYPTION" == "TRUE" ]; then @@ -23,10 +23,10 @@ function create(){ p_header > "$TMP_NOTE" encrypt else - p_header > "$NOTE_DIR/$NOTE" + p_header > "$NOTES_DIR/$NOTE" fi # Make sure the note exists, and inform the user of the result. - if [ -e "$NOTE_DIR/$NOTE" ]; then + if [ -e "$NOTES_DIR/$NOTE" ]; then printf " - %s\n" "Created note: ${NOTE%.*}" else >&2 printf " $RED_COLOR!$RESET_COLOR%s\n"\ diff --git a/src/includes/delete.sns.sh b/src/includes/delete.sns.sh index 4404f95..5c5ee49 100644 --- a/src/includes/delete.sns.sh +++ b/src/includes/delete.sns.sh @@ -2,8 +2,8 @@ function delete(){ # Requires: $NOTE, $NOTE_DIR # Given a valid $NOTE, delete removes $NOTE from sns. - if [ -e "$NOTE_DIR/$NOTE" ]; then - rm "$NOTE_DIR/$NOTE" + if [ -e "$NOTES_DIR/$NOTE" ]; then + rm "$NOTES_DIR/$NOTE" printf " - %s\n" "Deleted note: ${NOTE%.*}." else >&2 printf " $RED_COLOR!$RESET_COLOR %s\n" "Note ${NOTE%.*} does not exist." diff --git a/src/includes/print.sns.sh b/src/includes/print.sns.sh index fba75a4..7b6d2eb 100644 --- a/src/includes/print.sns.sh +++ b/src/includes/print.sns.sh @@ -3,7 +3,7 @@ function print(){ if [ -r "$NOTE" ]; then if [ "$ENCRYPTION" == "TRUE" ]; then decrypt #to stdout - else cat "$NOTE" fi + else cat "$NOTE"; fi else >&2 printf " $RED_COLOR!$RESET_COLOR %s\n\t%s\n"\ "Note cannot be found." diff --git a/src/main/stage1.sns.sh b/src/main/stage1.sns.sh index 40cbd1e..26ec031 100644 --- a/src/main/stage1.sns.sh +++ b/src/main/stage1.sns.sh @@ -11,7 +11,7 @@ else fi if [ "$ENCRYPTION" == "TRUE" ]; then - if [ ! -r $(which gpg) ]; then + if [ ! -r "$(which gpg)" ]; then >&2 printf " $RED_COLOR!$RESET_COLOR %s\n\t%s\n"\ "Encryption was specified, but GPG is not installed." exit 100