Fixed unterminated if

This commit is contained in:
Jon Lewis
2018-02-01 16:56:52 -06:00
parent 2c45921083
commit b1d2236e07

15
vns
View File

@@ -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