[chk_deployed_ids] Improved logging

This commit is contained in:
ayakael 2019-04-12 22:08:41 -04:00
parent d2c4b8443b
commit 2e3f52aab0
Signed by untrusted user who does not match committer: forge
GPG key ID: D62A472A4AA7D541

View file

@ -35,11 +35,11 @@ chk_deployed_ids() {
fi
if [[ -z "$(awk -v imageid=${IMAGEID} -v trackid=${TRACKID} 'BEGIN{FS="\t"}{if($2==imageid && $3==trackid){print $0}}' ${DB_FILE})" ]]; then
local ERR=true
echo "Fixing accounting for ${flac}" > ${STDERR}
_ansi up 2; echo -en '\033[K'; echo "[ ${COUNT} / ${#flacList[@]} ] Fixing accounting for ${flac}"
echo -e "true\t${IMAGEID}\t${TRACKID}\t${flac}" >> ${DB_FILE}
elif [[ "$(awk -v imageid=${IMAGEID} -v trackid=${TRACKID} 'BEGIN{FS="\t"}{if($2==imageid && $3==trackid){print $4}}' ${DB_FILE})" != "${flac}" ]]; then
local ERR=true
echo "Fixing path for ${flac}" > ${STDERR}
_ansi up 2; echo -en '\033[K'; echo "[ ${COUNT} / ${#flacList[@]} ] Fixing path for ${flac}"
gawk -i inplace -v imageid=${IMAGEID} -v trackid=${TRACKID} 'BEGIN{FS="\t"}{if($2==imageid && $3==trackid){$4=path}{print $0}}' ${DB_FILE}
fi
done