[print_imageid_du] Attempt at fixing "dc: stack empty" message when no tracks are selected, this time with return

This commit is contained in:
ayakael 2018-05-15 23:29:00 -07:00
parent b9f882d5d1
commit dba832edba
No known key found for this signature in database
GPG key ID: 575626A4AE5F4026

View file

@ -15,6 +15,6 @@ print_imageid_du() {
local imageidList=(${@})
[[ -z "${imageidList[@]}" ]] && echo 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[@]}" ]] && echo 0
[[ -z "${bytesList[@]}" ]] && return 0
dc <<< '[+]sa[z2!>az2!>b]sb'"$(sed 's/"//g' <<< "${bytesList[@]}")lbxp"
}