Print nothing for empty stores
This commit is contained in:
10
vns
10
vns
@@ -112,14 +112,18 @@ 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=""
|
||||||
printf "%s\n" "Store"
|
if [ "$(numNotes)" != "0" ];then
|
||||||
else
|
printf "%s\n" "Store"
|
||||||
|
fi
|
||||||
|
else
|
||||||
readonly NOTEBOOK="$1"
|
readonly NOTEBOOK="$1"
|
||||||
printf "%s\n" "$1"
|
printf "%s\n" "$1"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
tree -C --noreport --prune "$VNS_STORE/$NOTEBOOK"\
|
tree -C --noreport --prune "$VNS_STORE/$NOTEBOOK"\
|
||||||
| tail -n +2\
|
| tail -n +2\
|
||||||
|
|||||||
Reference in New Issue
Block a user