From b1d2236e0799aa48ddbb66df24026b5b1bb3fde6 Mon Sep 17 00:00:00 2001 From: Jon Lewis Date: Thu, 1 Feb 2018 16:56:52 -0600 Subject: [PATCH] Fixed unterminated if --- vns | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/vns b/vns index 8f20c99..f3c2a49 100755 --- a/vns +++ b/vns @@ -165,6 +165,13 @@ vns_create () { # Create-Edit the note vim "$VNS_STORE/$1.gpg" + + # Warn the user if the note failed to encrypt + if ! grep "PGP" <<< "$(file "$VNS_STORE/$1")" > /dev/null; then + printf "$VNS_RED_COLOR!$VNS_RESET_COLOR - %s\n %s\n"\ + "The created note was not encrypted."\ + "Check your vim-gnupg setup." + fi # Update Git git add "$VNS_STORE/$1.gpg" > /dev/null @@ -186,12 +193,6 @@ vns_edit () { # Edit the specified note vim "$VNS_STORE/$1.gpg" - # Warn the user if the note failed to encrypt - if ! grep "PGP" <<< "$(file "$VNS_STORE/$1")" > /dev/null; then - printf "$VNS_RED_COLOR!$VNS_RESET_COLOR - %s\n %s\n"\ - "The created note was not encrypted."\ - "Check your vim-gnupg setup." - # Update Git git add "$VNS_STORE/$1.gpg" > /dev/null git commit -m "Edited $1" > /dev/null @@ -217,7 +218,7 @@ vns () { if [ "$*" != "-i" ]; then vns_sanityCheck; # Change Directory to Store for Git passthrough - cd $VNS_STORE || exit; + cd "$VNS_STORE" || exit; fi