Print nothing for empty stores

This commit is contained in:
Jon Lewis
2018-02-05 18:38:57 -06:00
parent 0c2e8c1912
commit 2334d88b0c

4
vns
View File

@@ -112,10 +112,14 @@ vns_list () {
# Prints a tree containing all notes in the notebook # Prints a tree containing all notes in the notebook
# If no notebook is specified, the entire store is used # If no notebook is specified, the entire store is used
numNotes () { find . -name "*.gpg" \( ! -regex '.*/\..*' \) | wc -l; }
# Check for default behavior # Check for default behavior
if [ -z "${*:1:1}" ]; then if [ -z "${*:1:1}" ]; then
readonly NOTEBOOK="" readonly NOTEBOOK=""
if [ "$(numNotes)" != "0" ];then
printf "%s\n" "Store" printf "%s\n" "Store"
fi
else else
readonly NOTEBOOK="$1" readonly NOTEBOOK="$1"
printf "%s\n" "$1" printf "%s\n" "$1"