From 2d4c714ba20903d8615a323527dbe5ec5917f1b2 Mon Sep 17 00:00:00 2001 From: ayakael Date: Tue, 15 May 2018 23:45:28 -0700 Subject: [PATCH] [print_imageid_du] Function exits gracefully when no imageids are present --- src/print_imageid_du | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/print_imageid_du b/src/print_imageid_du index cae880f..2a44e8a 100644 --- a/src/print_imageid_du +++ b/src/print_imageid_du @@ -13,7 +13,7 @@ print_imageid_du() { local GIT_DIR="${1}"; shift local imageidList=(${@}) - [[ -z "${imageidList[@]}" ]] && echo 0 + [[ -z "${imageidList[@]}" ]] && return 0 local bytesList=($(awk 'BEGIN{RS=",";FS=":"}{if($1=="\"size\""){print $2}}' <<<$(git -C "${GIT_DIR}" annex info --bytes --json $(printf "%s.flac\t" ${imageidList[@]})))) [[ -z "${bytesList[@]}" ]] && return 0 dc <<< '[+]sa[z2!>az2!>b]sb'"$(sed 's/"//g' <<< "${bytesList[@]}")lbxp"