[print_imageid_du] When gracefull exit occurs, assume that files represent 0 bytes

This commit is contained in:
ayakael 2018-05-15 23:46:57 -07:00
parent 2d4c714ba2
commit d4200094cc
No known key found for this signature in database
GPG key ID: 575626A4AE5F4026

View file

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